[Bug lto/50367] New: -flto and -Wl,--as-needed combination removes some needed libraries

krisztian.kocsis at optimaster dot eu gcc-bugzilla@gcc.gnu.org
Mon Sep 12 18:25:00 GMT 2011


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

             Bug #: 50367
           Summary: -flto and -Wl,--as-needed combination removes some
                    needed libraries
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: krisztian.kocsis@optimaster.eu


Created attachment 25250
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25250
Verbose linker output.

When I try to build udev with gcc-4.6.1, the accelerometer module fails to link
because of undefined references to sqrt, atan, etc. Unfortunately -lm is
explicitly specified. If I remove -flto or -Wl,--as-needed, the module links
successfully.

Verbose linker output is attached.



More information about the Gcc-bugs mailing list