From: Willem Jan Withagen Date: Wed, 23 Oct 2019 12:12:25 +0000 (+0200) Subject: cmake: use GNU linker on FreeBSD X-Git-Tag: v15.1.0~799^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b1199d8013f0ff158e481f7726737d26e965cd2;p=ceph.git cmake: use GNU linker on FreeBSD The LLVM ld linker does not understand the versioning mapping. This is a "documented" difference between GNU ld en LLVM ld. So we fall back to the GNU linker in the binutils package. Fixing this with a option to cmake is not possible when building FreeBSD packages. Many of these options are filtered in the ports make system. And do not make it to cmake being called to build the build-tree. Signed-off-by: Willem Jan Withagen --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b1295cd0c2a..a6c673c4094a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,6 +67,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-varargs") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-designator") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register") + if(FREEBSD) + # Need to use the GNU binutils linker to get versioning right. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=/usr/local/bin/ld -Wno-unused-command-line-argument") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=/usr/local/bin/ld -Wno-unused-command-line-argument") + endif() if(APPLE) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup") endif()