You are not logged in.
I'd need to know which linker flag for Clang does the same job that --no-as-needed does for GCC. I searched the web with no success, and I'm afraid to go through the documentation of all the Clang linker options, so if someone can give me a quick answer this would save me a lot of time and pain.
Thanks in advance.
Offline
compiler and linker are separate entities and it is possible to use different linkers with a specific compiler.
(gcc can use atleast 3 linkers) .
--no-as-needed is a ld.so option , and you can use that with llvm/clang .
The llvm project has ld.lld (project name is lld) as linker, are you trying to use that ?
That linker supports --no-as-needed .
--no-as-needed
Always set DT_NEEDED for shared libraries.
Last edited by Lone_Wolf (2023-12-12 13:09:11)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
I was trying to help a friend using macOS and seeing a strange linker (ld) behavior resulting in some libraries not being linked to the executable, as can happen when the linker defaults to `--as-needed`. Turned out it was a problem related to running in a python virtual environment, so in the end nothing related to the linker itself. Thanks anyway for the help.
Offline