https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97304
--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (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.