aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2018-10-13 17:07:56 +0200
committerTheCharlatan <seb.kung@gmail.com>2018-12-04 02:21:06 +0100
commit5a76933903ef2f29532588d359862831a3644128 (patch)
tree88dd643545c7fab6b9bca156dfb9ed8d230db2d0 /CMakeLists.txt
parentMerge pull request #4781 (diff)
downloadmonero-5a76933903ef2f29532588d359862831a3644128.tar.xz
Add glibc back compat code
To ensure that the binaries compiled by gitian run across many linux distributions, enforce 2.17 as the minimum libc version supported.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c38c673a..78dc14acb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -696,6 +696,13 @@ else()
set(LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap")
endif()
+ if(BACKCOMPAT)
+ add_definitions(-DFDELT_TYPE=long\ int)
+ add_linker_flag_if_supported(-Wl,--wrap=__divmoddi4 LD_BACKCOMPAT_FLAGS)
+ add_linker_flag_if_supported(-Wl,--wrap=glob LD_BACKCOMPAT_FLAGS)
+ message(STATUS "Using Lib C back compat flags: ${LD_BACKCOMPAT_FLAGS}")
+ endif()
+
# some windows linker bits
if (WIN32)
add_linker_flag_if_supported(-Wl,--dynamicbase LD_SECURITY_FLAGS)
@@ -708,7 +715,7 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS}")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${LD_BACKCOMPAT_FLAGS}")
# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
# is fixed in the code (Issue #847), force compiler to be conservative.