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: unassig...@gcc.gnu.org ReportedBy: krisztian.koc...@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.