[Bug c/105305] New: ARM32: gcc does not pass all library directories to linker

rui314 at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 19 06:01:19 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105305

            Bug ID: 105305
           Summary: ARM32: gcc does not pass all library directories to
                    linker
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rui314 at gmail dot com
  Target Milestone: ---

I'm the author of the mold linker (https://github.com/rui314/mold).

As far as I know, gcc always passes all library paths to the linker by -L<dir>,
but I got a bug report that that's not the case on ARM32. It is reported that
gcc does not pass some obvious paths such as `-L/usr` or `-L/usr/lib`. The code
to explicitly exclude "obvious" directories is here:
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=bb07cc244e30fbeccc701816db888f497d65eb08;hb=refs/heads/master#l7931

mold and LLVM lld don't have the notion of the default search paths for the
sake of build reproducibility. They guarantee that as long as you pass the
exact same command line options and input files, the linkers behave exactly the
same regardless of the host machine (in LLD, that's guaranteed even across Unix
and Windows.) That helps us a lot when we do cross compilation.

So, can gcc pass all library paths to the linker on ARM32?

https://github.com/rui314/mold/issues/336


More information about the Gcc-bugs mailing list