diff --git a/rehlds/HLTV/Console/CMakeLists.txt b/rehlds/HLTV/Console/CMakeLists.txt index 80a8e8f..90a78bd 100644 --- a/rehlds/HLTV/Console/CMakeLists.txt +++ b/rehlds/HLTV/Console/CMakeLists.txt @@ -40,7 +40,7 @@ if (USE_INTEL_COMPILER) else() # Produce code optimized for the most common IA32/AMD64/EM64T processors. # As new processors are deployed in the marketplace, the behavior of this option will change. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3\ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3 -flto\ -fpermissive -fno-sized-deallocation\ -Wno-unused-result -Wno-unknown-pragmas -Wno-write-strings") diff --git a/rehlds/HLTV/Core/CMakeLists.txt b/rehlds/HLTV/Core/CMakeLists.txt index 0fbdb9a..5acbef8 100644 --- a/rehlds/HLTV/Core/CMakeLists.txt +++ b/rehlds/HLTV/Core/CMakeLists.txt @@ -35,7 +35,7 @@ if (USE_INTEL_COMPILER) else() # Produce code optimized for the most common IA32/AMD64/EM64T processors. # As new processors are deployed in the marketplace, the behavior of this option will change. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3\ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3 -flto\ -fpermissive -fno-sized-deallocation\ -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-variable\ -Wno-sign-compare -Wno-write-strings -Wno-strict-aliasing") diff --git a/rehlds/HLTV/DemoPlayer/CMakeLists.txt b/rehlds/HLTV/DemoPlayer/CMakeLists.txt index 3161e1d..8d8366d 100644 --- a/rehlds/HLTV/DemoPlayer/CMakeLists.txt +++ b/rehlds/HLTV/DemoPlayer/CMakeLists.txt @@ -35,7 +35,7 @@ if (USE_INTEL_COMPILER) else() # Produce code optimized for the most common IA32/AMD64/EM64T processors. # As new processors are deployed in the marketplace, the behavior of this option will change. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3\ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3 -flto\ -fpermissive -fno-sized-deallocation\ -Wno-unused-result -Wno-unknown-pragmas\ -Wno-sign-compare -Wno-write-strings -Wno-strict-aliasing") diff --git a/rehlds/HLTV/Director/CMakeLists.txt b/rehlds/HLTV/Director/CMakeLists.txt index fa7264f..4582be4 100644 --- a/rehlds/HLTV/Director/CMakeLists.txt +++ b/rehlds/HLTV/Director/CMakeLists.txt @@ -35,7 +35,7 @@ if (USE_INTEL_COMPILER) else() # Produce code optimized for the most common IA32/AMD64/EM64T processors. # As new processors are deployed in the marketplace, the behavior of this option will change. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3\ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3 -flto\ -fpermissive -fno-sized-deallocation\ -Wno-unused-result -Wno-unknown-pragmas\ -Wno-write-strings -Wno-strict-aliasing") @@ -98,11 +98,8 @@ add_definitions( -D_snprintf=snprintf ) -if (NOT TARGET appversion) - add_custom_target(appversion DEPENDS COMMAND "${PROJECT_SOURCE_DIR}/../../version/appversion.sh" "${PROJECT_SOURCE_DIR}/../..") -endif() +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN/.' -L${PROJECT_SOURCE_DIR}/../../lib/linux32") -add_library(director SHARED ${appversion.sh} ${DIRECTOR_SRCS} ${COMMON_SRCS}) -target_link_libraries(director dl) +add_library(director SHARED ${DIRECTOR_SRCS} ${COMMON_SRCS}) +target_link_libraries(director dl m) set_target_properties(director PROPERTIES PREFIX "" COMPILE_FLAGS "-m32" LINK_FLAGS "-m32" POSITION_INDEPENDENT_CODE ON) -add_dependencies(director appversion) diff --git a/rehlds/HLTV/Director/src/Director.cpp b/rehlds/HLTV/Director/src/Director.cpp index a9c8262..2787de3 100644 --- a/rehlds/HLTV/Director/src/Director.cpp +++ b/rehlds/HLTV/Director/src/Director.cpp @@ -32,20 +32,6 @@ 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. -// NOTE: This workaround seem not compatible with -flto compile GCC option. - -__asm__(".symver expf,expf@GLIBC_" GLIBC_expf_VERSION); - -#endif // #if defined(_WIN32) - bool Director::Init(IBaseSystem *system, int serial, char *name) { BaseSystemModule::Init(system, serial, name); diff --git a/rehlds/HLTV/Proxy/CMakeLists.txt b/rehlds/HLTV/Proxy/CMakeLists.txt index 69653f4..9d0a7e9 100644 --- a/rehlds/HLTV/Proxy/CMakeLists.txt +++ b/rehlds/HLTV/Proxy/CMakeLists.txt @@ -35,7 +35,7 @@ if (USE_INTEL_COMPILER) else() # Produce code optimized for the most common IA32/AMD64/EM64T processors. # As new processors are deployed in the marketplace, the behavior of this option will change. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3\ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic -msse3 -flto\ -fpermissive -fno-sized-deallocation\ -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-variable\ -Wno-write-strings -Wno-strict-aliasing") @@ -131,5 +131,5 @@ if (NOT TARGET bzip2) endif() add_library(proxy SHARED ${PROXY_SRCS} ${COMMON_SRCS}) -target_link_libraries(proxy dl bzip2 steam_api) +target_link_libraries(proxy dl m bzip2 steam_api) set_target_properties(proxy PROPERTIES PREFIX "" COMPILE_FLAGS "-m32" LINK_FLAGS "-m32" POSITION_INDEPENDENT_CODE ON) diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 507f51c..add30da 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -597,20 +597,6 @@ double EXT_FUNC Sys_FloatTime(void) #else // not _WIN32 -#if __GNUC__ >= 8 - -#define GLIBC_clock_gettime_VERSION "2.2" - -// -// Building go on GCC 8.3 or greater that have newest clock_gettime GLIBC.2.17 than -// available on the destination virtual machine, so we can downgrade GLIBC version -// for this function. -// NOTE: This workaround seem not compatible with -flto compile GCC option. - -__asm__(".symver clock_gettime,clock_gettime@GLIBC_" GLIBC_clock_gettime_VERSION); - -#endif // #if __GNUC__ >= 8 - double Sys_FloatTime(void) { static struct timespec start_time; diff --git a/rehlds/lib/linux32/libm.so b/rehlds/lib/linux32/libm.so new file mode 100644 index 0000000..b0430eb Binary files /dev/null and b/rehlds/lib/linux32/libm.so differ diff --git a/rehlds/lib/linux32/librt.so b/rehlds/lib/linux32/librt.so new file mode 100644 index 0000000..4b39fa4 Binary files /dev/null and b/rehlds/lib/linux32/librt.so differ