This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/48447] LTO link fails to link libgcc correctly when -nostdlib option is specified
- From: "davek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 7 Apr 2011 15:49:39 +0000
- Subject: [Bug lto/48447] LTO link fails to link libgcc correctly when -nostdlib option is specified
- Auto-submitted: auto-generated
- References: <bug-48447-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48447
--- Comment #5 from Dave Korn <davek at gcc dot gnu.org> 2011-04-07 15:49:29 UTC ---
Well, this is basically a weakness in the pass-through solution implemented for
PR 42690; it only knows about the compilers stdlibs, and doesn't process any
user-specified libs on the command line. In the general case that's how things
ought to be: LTRANS only generates new references to builtins/libcalls, not any
of the user's code. However when you use -nostdlib and pass libgcc as if it
were a user library, as in case 3, the pass-through mechanism doesn't know that
it's actually a compiler runtime rather than user library and doesn't pass it
through.
The correct fix is going to be in the linker, not the compiler, by implementing
a second library scan pass and obsoleting the pass-through mechanism. I've got
a revised version of that experimental patch that I'll attach to this PR for
reference.