Current libtool does not yet work with lto.  When generating symbol lists, it
does not grep out __gnu_lto_v1 (BTW, which would be the right pattern to grep
out?)

Anyway, that can cause something like this to happen:

cat >a.c <<'EOF'
extern char __gnu_lto_v1;

const struct {
  const char *name;
  void *address;
}
lt_libltdl_LTX_preloaded_symbols[] =
{ {"__gnu_lto_v1", (void *) &__gnu_lto_v1}
};
EOF

gcc -fno-builtin -fPIC -c a.c
gcc -flto -fPIC -shared -o liba.so a.o

resulting in this:

lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: gcc returned 1 exit status
collect2: lto-wrapper returned 1 exit status

And yes, the lack of -flto in the compile line is another bug in libtool.


-- 
           Summary: LTO segfault with object referencing __gnu_lto_v1
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwild at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu


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

Reply via email to