Search code examples
gcclld

Specifying custom linker executable to g++


I would like to try the LLVM linker (lld) on our project. We use gcc 6, so apparently the -fuse-ld=lld flag is not available yet. I don't control the ld executable used by default, so I can't replace it with a symlink. Are there any other options?

The build system we use is make, and linking is done by the compiler, not a direct call to ld.


Solution

  • One easy workaround is to modify PATH environment variable to point to custom ld executable (see the example here).