]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: use GNU linker on FreeBSD
authorWillem Jan Withagen <wjw@digiware.nl>
Wed, 23 Oct 2019 12:12:25 +0000 (14:12 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Wed, 23 Oct 2019 16:43:04 +0000 (18:43 +0200)
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 <wjw@digiware.nl>
src/CMakeLists.txt

index 3b1295cd0c2a1efbfc27b5ff7e6baca089b95c95..a6c673c4094a8a9bb60e41290997850ab0807753 100644 (file)
@@ -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()