mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-17 20:10:21 +03:00
Fix gcc 9/10 & mapbase build errors
This commit is contained in:
59
sp/src/devtools/gcc9+support.cpp
Normal file
59
sp/src/devtools/gcc9+support.cpp
Normal 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
|
||||
@@ -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 $@ ;\
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user