2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-02-26 21:41:06 +03:00

HLTV: Downgrade GLIBC version

This commit is contained in:
s1lentq 2021-03-23 01:10:55 +07:00
parent 42fd0fadfa
commit 80b849f39e
3 changed files with 28 additions and 1 deletions

View File

@ -41,6 +41,10 @@ else()
-Wno-write-strings -Wno-strict-aliasing")
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--wrap=expf")
endif()
set(PROJECT_SRC_DIR
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_SOURCE_DIR}/../"

View File

@ -32,6 +32,25 @@
EXPOSE_SINGLE_INTERFACE(Director, IDirector, DIRECTOR_INTERFACE_VERSION);
#endif // DIRECTOR_MODULE
#if !defined(_WIN32) && __GNUC__ >= 8
#define GLIBC_expf_VERSION "2.0"
//
// Building go on GCC 8.3 or greater that have newest expf GLIBC.2.27 than
// available on the destination virtual machine, so we can downgrade GLIBC version
// for this function.
// Use for linker: -Wl,--wrap=expf
extern int expf(int __fd, int __cmd, ...);
__asm__(".symver expf,expf@GLIBC_" GLIBC_expf_VERSION);
DLL_EXPORT float __wrap_expf(float x)
{
return expf(x);
}
#endif // #if defined(_WIN32)
bool Director::Init(IBaseSystem *system, int serial, char *name)
{
BaseSystemModule::Init(system, serial, name);
@ -49,7 +68,7 @@ bool Director::Init(IBaseSystem *system, int serial, char *name)
m_slowMotion = 0.5f;
for (int i = 0; i < MAX_WORLD_HISTORY; i++) {
m_gaussFilter[i] = 1.0f / exp((i * i) / 10000.0f);
m_gaussFilter[i] = 1.0f / expf((i * i) / 10000.0f);
}
m_World = nullptr;

View File

@ -45,6 +45,10 @@ else()
endif()
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--wrap=expf")
endif()
set(PROJECT_SRC_DIR
"${PROJECT_SOURCE_DIR}/src"
"${PROJECT_SOURCE_DIR}/../"