]> git.ipfire.org Git - thirdparty/gcc.git/commit
Don't remove /usr/lib and /lib from when passing to the linker [PR97304/104707]
authorAndrew Pinski <quic_apinski@quicinc.com>
Tue, 16 Apr 2024 19:06:51 +0000 (12:06 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 30 Aug 2024 14:10:13 +0000 (07:10 -0700)
commit3fb90724cec7e76b60fb910fa98b4ebec9912a31
tree6648bd186f6c7dd939b08b976c665f8713406238
parent4d2cbe2bbedbdbc609683f7fb491b3e02add15b3
Don't remove /usr/lib and /lib from when passing to the linker [PR97304/104707]

With newer ld, the default search library path does not include /usr/lib nor /lib
but the driver decides to not pass -L down to the link for these and then in some/most
cases libc is not found.
This code dates from at least 1992 and it is done in a way which is not safe and
does not make sense. So let's remove it.

Bootstrapped and tested on x86_64-linux-gnu (which defaults to being a multilib).

gcc/ChangeLog:

PR driver/104707
PR driver/97304

* gcc.cc (is_directory): Don't not include /usr/lib and /lib
for library directory pathes. Remove library argument.
(add_to_obstack): Update call to is_directory.
(driver_handle_option): Likewise.
(spec_path): Likewise.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/gcc.cc