https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104707
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:3fb90724cec7e76b60fb910fa98b4ebec9912a31 commit r15-3321-g3fb90724cec7e76b60fb910fa98b4ebec9912a31 Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Tue Apr 16 12:06:51 2024 -0700 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_apin...@quicinc.com>