Fix gcc 9/10 & mapbase build errors

This commit is contained in:
Alexander 'z33ky' Hirsch
2020-06-14 10:39:08 +02:00
parent 4d45c32be9
commit 9d0f5197bd
33 changed files with 267 additions and 204 deletions

View File

@@ -0,0 +1,59 @@
// compatibility with old ABI
#if __GNUC__ >= 9
#include <cmath>
extern "C" double __pow_finite(double a, double b)
{
return pow(a, b);
}
extern "C" double __log_finite(double a)
{
return log(a);
}
extern "C" double __exp_finite(double a)
{
return exp(a);
}
extern "C" double __atan2_finite(double a, double b)
{
return atan2(a, b);
}
extern "C" double __atan2f_finite(double a, double b)
{
return atan2f(a, b);
}
extern "C" float __powf_finite(float a, float b)
{
return powf(a, b);
}
extern "C" float __logf_finite(float a)
{
return logf(a);
}
extern "C" float __expf_finite(float a)
{
return expf(a);
}
extern "C" float __acosf_finite(float a)
{
return acosf(a);
}
extern "C" double __asin_finite(double a)
{
return asin(a);
}
extern "C" double __acos_finite(double a)
{
return acos(a);
}
#endif

View File

@@ -8,6 +8,7 @@ MAKEFILE_LINK:=$(THISFILE).link
$(MAKEFILE_LINK): $(shell which $(CC)) $(THISFILE)
if [ "$(shell printf "$(shell $(CC) -dumpversion)\n8" | sort -Vr | head -1)" = 8 ]; then \
$(COMPILE.cpp) -o gcc9+support.o gcc9+support.c ;\
ln -sf $(MAKEFILE_BASE).default $@ ;\
else \
ln -sf $(MAKEFILE_BASE).gcc8 $@ ;\

View File

@@ -94,9 +94,9 @@ ifeq ($(OS),Linux)
# So symbols like _Z16ClearMultiDamagev should show up when you do "nm server_srv.so" in TF2.
STRIP_FLAGS = -x
endif
# core2 = MMX, SSE, SSE2, SSE3, SSSE3
MARCH_TARGET = core2
MTUNE_TARGET = sandybridge
# nocona = MMX, SSE, SSE2, SSE3
MARCH_TARGET = nocona
MTUNE_TARGET = generic
ifeq ($(CXX),clang++)
# Clang does not support -mfpmath=sse because it uses whatever
@@ -174,7 +174,7 @@ ifeq ($(OS),Linux)
LIB_END_EXE = -Wl,--end-group -lm -ldl $(LIBSTDCXX) -lpthread
LIB_START_SHLIB = $(PATHWRAP) -static-libgcc -Wl,--start-group
LIB_END_SHLIB = -Wl,--end-group -lm -ldl $(LIBSTDCXXPIC) -lpthread -l:$(LD_SO) -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt
LIB_END_SHLIB = -Wl,--end-group $(SRCROOT)/devtools/gcc9+support.o -lm -ldl $(LIBSTDCXXPIC) -lpthread -l:$(LD_SO) -Wl,--version-script=$(SRCROOT)/devtools/version_script.linux.txt
endif