Hi Andrew, > On 17 Apr 2024, at 14:59, Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote:
>> The driver currently will remove "/lib" and "/usr/lib" from the library >> path that gets passed to the linker because it considers them as paths that >> the linker will already known to search. But this is not true for newer >> linkers, mold and lld for an example don't have a default search path. >> This patch removes the special casing to fix FreeBSD building where lld is >> used by default and also fix riscv-linux-gnu when used in combination with >> mold. >> I have tested it on x86_64-linux-gnu and it works there but since the code >> in the driver has been around since 1992, I request some folks to test it >> on AIX, Mac OS (Darwin) and solaris where the ld is not GNU bfd ld as I >> don't have access to those targets currently. > > actually, you do: all of those are availble inside the cfarm. > > I've also tested the patch on i386-pc-solaris2.11 and > sparc-sun-solaris2.11 with the native ld: no regressions in either case. I tested so far on x86_64 darwin, but the behaviour of collect2 is the same for all arches. Actually, I do not see any difference in behaviour when looking at the -Wl,-v output (it seems that somehow those paths are not currently pruned for Darwin; if I add -L /lib to the command line on a GCC build without this patch it is passed through despite that it’s non-existent). However, that’s a separate bug, perhaps. So - as far as this patch is concerned it seems OK for Darwin, Iain