[Bug target/97304] Boostrap failure on freebsd: ld: error: unable to find library -lc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304 --- Comment #15 from Thomas Koenig --- (In reply to Andrew Pinski from comment #14) > (In reply to Jonathan Wakely from comment #10) > > If --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld is required then > > it needs to be documented at > > https://gcc.gnu.org/install/specific.html#x-x-freebsd > > So what I think is happening is the ld (LLVM's lld) does not include > /usr/lib by default in the library search path and gcc's driver does not > pass -L/usr/lib -L/lib on to ld because it assumes all ld normally search > there by default (which most unix ld did before lld and mold come around). > [...] > I am suspect we might be able to remove this and it will work but there > needs to be a lot of testing on many different targets and such. A configure test, maybe?
[Bug target/97304] Boostrap failure on freebsd: ld: error: unable to find library -lc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304 --- Comment #14 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #10) > If --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld is required then > it needs to be documented at > https://gcc.gnu.org/install/specific.html#x-x-freebsd So what I think is happening is the ld (LLVM's lld) does not include /usr/lib by default in the library search path and gcc's driver does not pass -L/usr/lib -L/lib on to ld because it assumes all ld normally search there by default (which most unix ld did before lld and mold come around). Here is the code inside gcc.cc (is_directory) that excludes them: /* Exclude directories that the linker is known to search. */ if (linker && IS_DIR_SEPARATOR (path[0]) && ((cp - path == 6 && filename_ncmp (path + 1, "lib", 3) == 0) || (cp - path == 10 && filename_ncmp (path + 1, "usr", 3) == 0 && IS_DIR_SEPARATOR (path[4]) && filename_ncmp (path + 5, "lib", 3) == 0))) return 0; I am suspect we might be able to remove this and it will work but there needs to be a lot of testing on many different targets and such.
[Bug target/97304] Boostrap failure on freebsd: ld: error: unable to find library -lc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304 --- Comment #13 from Jonathan Wakely --- (In reply to Andrew Pinski from comment #11) > *** Bug 112745 has been marked as a duplicate of this bug. *** And as suggested in Bug 112745, either lld should Just Work or GCC should work around whatever weirdness means it can't find libc. (In reply to Andrew Pinski from comment #12) > I think this is related to PR 104707 . Aha, maybe - I was using --disable-multilib It doesn't look like Rainer was though.
[Bug target/97304] Boostrap failure on freebsd: ld: error: unable to find library -lc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=104707 --- Comment #12 from Andrew Pinski --- I think this is related to PR 104707 .
[Bug target/97304] Boostrap failure on freebsd: ld: error: unable to find library -lc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304 Thomas Koenig changed: What|Removed |Added Component|bootstrap |target --- Comment #3 from Thomas Koenig --- Again, the files are on gcc303.fsffrance.org in /home/tkoenig .