http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49612
Summary: LTO cannot link objects Product: gcc Version: 4.5.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassig...@gcc.gnu.org ReportedBy: krisztian.koc...@optimaster.eu I made a toolchain for embedded Geode CPUs but if LTO is enabled (-flto) then the compiler cannot link objects. Piece of config.log from fuse: configure:3352: checking whether the C compiler works configure:3374: /project/optinux/toolchains/geode-lx-r1/bin/i686-optinux-linux-gnu-gcc -pipe --param l1-cache-line-size=32 --param l1-cache-size=64 --param l2-cache-size=128 -march=i686 -mtune=geode -mmmx -m3dnow -g -O2 -fmodulo-sched -fgcse-after-reload -ftree-loop-linear -fivopts -flto -D__optinux_target_geode_lx_r1__ -D__optinux_target__ -D__optinux__ -Wl,-O1 -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,noexecstack -Wl,-z,noexecheap -Wl,--enable-new-dtags -Wl,--gc-sections -Wl,--hash-style=both ../sysdeps/generic/initfini.c:86:1: error: '_init' has already been defined ../sysdeps/generic/initfini.c:86:1: note: previously defined here ../sysdeps/generic/initfini.c:63:1: error: 'dummy' has already been defined ../sysdeps/generic/initfini.c:63:1: note: previously defined here ../sysdeps/generic/initfini.c:112:1: error: '_fini' has already been defined ../sysdeps/generic/initfini.c:112:1: note: previously defined here lto-wrapper: /project/optinux/toolchains/geode-lx-r1/bin/i686-optinux-linux-gnu-gcc returned 1 exit status lto-wrapper: deleting LTRANS file /tmp/ccoThRvh.lto.o: No such file or directory collect2: lto-wrapper returned 1 exit status configure:3378: $? = 1 configure:3416: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "fuse" | #define PACKAGE_TARNAME "fuse" | #define PACKAGE_VERSION "2.8.5" | #define PACKAGE_STRING "fuse 2.8.5" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "fuse" | #define VERSION "2.8.5" | /* end confdefs.h. */ |. | int | main () | { |. | ; | return 0; | } configure:3421: error: in `/project/optinux/products/mpbr/.builds/fuse-2.8.5': configure:3423: error: C compiler cannot create executables See `config.log' for more details If I remove '-flto' then everything works OK! gmp-5.0.2 mpfr-3.0.1 ppl-0.10.2 cloog-ppl-0.15.11 mpc-0.9 libelf-0.8.13 linux-2.6.35 (headers) binutils-2.21 gcc-4.5.3 eglibc-2.14