[clang] [Clang][Solaris] Support --ld-path in Solaris driver (PR #163000)

Daniel Levin via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 21 05:00:16 PST 2025


daniel-levin wrote:

> This is wrong: the linker is run using execve or posix_spawn, both of which expect a pathname, not a filename, and don't do a PATH search.

Please try again. I force pushed several changes after that comment. It now works with `gld` and `bfd`, as well as `/usr/gnu/bin/ld`.

I maintain that the unit tests enforce wrong behavior. Consider these tests: https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/solaris-ld.c

They check for the presence of Solaris LD specific flags, which is the correct thing to test for only if `CLANG_DEFAULT_LINKER` is unset.

https://github.com/llvm/llvm-project/pull/163000


More information about the cfe-commits mailing list