Using a different linker in a CMake project

Willem Jan Withagen wjw at digiware.nl
Thu Sep 26 16:18:18 UTC 2019


Hi,

For building ceph14 in I need to use ld from the ports binutils.
Mainly because of versioning that I can not get to work with the llvm 
linker, and is a know difference between GNU ld en LLVM ld.

Just building in the project I was able to do that with:
   -D  CMAKE_CXX_FLAGS_DEBUG=" -fuse-ld=/usr/local/bin/ld 
-Wno-unused-command-line-argument"

So I'm trying to pass that also in the ports Makefile as a CMAKE_ARGS.
But nothing thusfar I've tried does actually work. and gets the option
on the commandline.

So is there a way to get this to work.
It is sort of tricky since CMAKE output uses cc of c++ to do linking.

A brute force hack would be to
	rm /usr/bin/ld
	ln -s /usr/local/bin/ld /usr/bin/ld
But I sure that that would not make it in the porst tree.

So suggestions welcomed.
--WjW


More information about the freebsd-ports mailing list