But passing LD=/path/to/my/linker to configure makes no difference
This is because LD
is almost never and should almost never be used to link any user-space program. Correct links are performed by using the appropriate compiler driver (gcc
, g++
, etc) instead.
What is the right way to configure a non-standard linker?
If you have /some/path/ld
and you want gcc
to use that ld
, pass -B/some/path
flag to gcc.
It then follows that you likely want:
./configure CC='gcc -B/some/path' CXX='g++ -B/some/path' ...