This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin
- From: "d dot g dot gorbachev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2010 16:55:50 -0000
- Subject: [Bug driver/42690] Undefined reference errors with -flto -fuse-linker-plugin
- References: <bug-42690-16926@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from d dot g dot gorbachev at gmail dot com 2010-01-16 16:55 -------
(In reply to comment #12)
> What options other than -nostdlib prevent gcc from linking libgcc and
> libc in the produced binary?
I know of -nodefaultlibs.
> To implement this we should always pass -plugin-opt=-pass-through=
> %(lto_libgcc) and -plugin-opt=-pass-through=-lc to the linker unless
> something like -nostdlib is used.
Wouldn't it be better to add %{fuse-linker-plugin:
-plugin-opt=-pass-through=...} to LIBGCC_SPEC and to LIB_SPEC?
However, the driver does not really know, whether we link with libgcc and/or
libc. Someone can use -nodefaultlibs together with -lc -lgcc and the linker
will still fail.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42690