public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/52405] New: undefined references in shared library when linking the shared library with -flto
@ 2012-02-27 17:16 doko at gcc dot gnu.org
  2012-02-28 10:46 ` [Bug lto/52405] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: doko at gcc dot gnu.org @ 2012-02-27 17:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52405

             Bug #: 52405
           Summary: undefined references in shared library when linking
                    the shared library with -flto
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: doko@gcc.gnu.org


seen with the 4.6 branch, and 4.7 20120223. The object files are built with
-flto as well.  Linking the shared library with -flto results in unresolved
symbols when linking against the share library. Not building the shared library
with -flto lets the launcher link succeed.

the object files (x86_64-linux-gnu) including the build script build.sh can be
found at
http://people.debian.org/~doko/tmp/hs.tar.xz

The undefined symbols come from inline template definitions in a header file.

gcc-4.7 -m64 -fpic -fno-rtti -fno-exceptions -fcheck-new -fvisibility=hidden
-m64 -flto -g -O3 -fno-strict-aliasing -fno-omit-frame-pointer
-fuse-linker-plugin -Xlinker -O1 -Wl,-Bsymbolic-functions   -Xlinker -z
-Xlinker noexecstack -m64 -Xlinker -export-dynamic  -L `pwd` -o gamma
launcher/java_md.o launcher/wildcard.o launcher/java.o launcher/jli_util.o
-ljvm -lm -ldl -lpthread
/home/packages/openjdk/7/openjdk-7-7~u3-2.1/build/openjdk.build-boot/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so:
undefined reference to `void
G1ParPushHeapRSClosure::do_oop_nv<oopDesc*>(oopDesc**)'
/home/packages/openjdk/7/openjdk-7-7~u3-2.1/build/openjdk.build-boot/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so:
undefined reference to `void
FilterIntoCSClosure::do_oop_nv<oopDesc*>(oopDesc**)'
/home/packages/openjdk/7/openjdk-7-7~u3-2.1/build/openjdk.build-boot/hotspot/outputdir/linux_amd64_compiler2/product/libjvm.so:
undefined reference to `void G1ParPushHeapRSClosure::do_oop_nv<unsigned
int>(unsigned int*)'
collect2: error: ld returned 1 exit status
make[8]: *** [gamma] Error 1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-26  2:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 17:16 [Bug lto/52405] New: undefined references in shared library when linking the shared library with -flto doko at gcc dot gnu.org
2012-02-28 10:46 ` [Bug lto/52405] " rguenth at gcc dot gnu.org
2012-02-28 13:38 ` doko at gcc dot gnu.org
2012-02-28 14:42 ` rguenth at gcc dot gnu.org
2021-12-26  2:01 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).