pam_ssh_agent_auth
pam_ssh_agent_auth copied to clipboard
Always use the compiler to call the linker
Building with LD defined as ld.lld fails with errors such as ld.lld: error: unknown argument '-Wl,-O1' (see https://bugs.gentoo.org/741927). This is because if LD is defined in the environment, it becomes the binary that executes the final link command. But LDFLAGS generally consist of flags prefixed with -Wl, that are designed to be passed by the compiler to the linker. Since linkers don't recognized such prefixed flags, linking fails.
In this context, the build's LD should always be $CC. Testing the final link command verbosely shows that the compiler selects the proper linker from the shell environment's $LD.