failed to compile v3.8 with LTO
Closed this issue · 4 comments
hi,
the same toolchain can compile c3.6 and v3.7 just fine, but fails to compile v3.8 on 2 machines here, during linking there are tons of undefined references.
I use this to compile "PATH=/opt/binutils-2.23.51.0.9/bin:$PATH make CC=gcc472 LD=ld-plugin", what am I doing wrong?
e.g.
/tmp/ccNbewVh.ltrans13.ltrans.o: In function `acpi_init.1100031':
ccNbewVh.ltrans13.o:(.init.text+0x126d): undefined reference to `kobject_create_and_add'
ccNbewVh.ltrans13.o:(.init.text+0x1654): undefined reference to `kobject_create_and_add'
ccNbewVh.ltrans13.o:(.init.text+0x1673): undefined reference to `kobject_create_and_add'
ccNbewVh.ltrans13.o:(.init.text+0x171c): undefined reference to `kobject_put'
ccNbewVh.ltrans13.o:(.init.text+0x1b0a): undefined reference to `kobject_uevent'
ccNbewVh.ltrans13.o:(.init.text+0x1b18): undefined reference to `kobject_uevent'
.
.
.
/tmp/ccNbewVh.ltrans14.ltrans.o: In function `rescan_partitions':
ccNbewVh.ltrans14.o:(.text+0x12a81): undefined reference to `snprintf'
ccNbewVh.ltrans14.o:(.text+0x12a89): undefined reference to `strlen'
ccNbewVh.ltrans14.o:(.text+0x12a94): undefined reference to `_ctype'
ccNbewVh.ltrans14.o:(.text+0x12bf5): undefined reference to `kobject_uevent'
ccNbewVh.ltrans14.o:(.text+0x12c5a): undefined reference to `strlcat'
ccNbewVh.ltrans14.o:(.text+0x12cc5): undefined reference to `strlcat'
.
.
.
On Mon, Mar 11, 2013 at 08:57:34AM -0700, xming wrote:
hi,
the same toolchain can compile c3.6 and v3.7 just fine, but fails to compile v3.8 on 2 machines here, during linking there are tons of undefined references.
I use this to compile "PATH=/opt/binutils-2.23.51.0.9/bin:$PATH make CC=gcc472 LD=ld-plugin", what am I doing wrong?
Please send your config
I got another similar report, but I don't know yet what causes it.
My own compiler/toolchain doesn't show any undefined symbols,
so it's probably some toolchain issue.
-Andi
e.g.
/tmp/ccNbewVh.ltrans13.ltrans.o: In function `acpi_init.1100031': ccNbewVh.ltrans13.o:(.init.text+0x126d): undefined reference to `kobject_create_and_add' ccNbewVh.ltrans13.o:(.init.text+0x1654): undefined reference to `kobject_create_and_add' ccNbewVh.ltrans13.o:(.init.text+0x1673): undefined reference to `kobject_create_and_add' ccNbewVh.ltrans13.o:(.init.text+0x171c): undefined reference to `kobject_put' ccNbewVh.ltrans13.o:(.init.text+0x1b0a): undefined reference to `kobject_uevent' ccNbewVh.ltrans13.o:(.init.text+0x1b18): undefined reference to `kobject_uevent' . . . /tmp/ccNbewVh.ltrans14.ltrans.o: In function `rescan_partitions': ccNbewVh.ltrans14.o:(.text+0x12a81): undefined reference to `snprintf' ccNbewVh.ltrans14.o:(.text+0x12a89): undefined reference to `strlen' ccNbewVh.ltrans14.o:(.text+0x12a94): undefined reference to `_ctype' ccNbewVh.ltrans14.o:(.text+0x12bf5): undefined reference to `kobject_uevent' ccNbewVh.ltrans14.o:(.text+0x12c5a): undefined reference to `strlcat' ccNbewVh.ltrans14.o:(.text+0x12cc5): undefined reference to `strlcat' . . .
Reply to this email directly or view it on GitHub:
#3
ak@linux.intel.com -- Speaking for myself only.
Here is the .config http://www.pastebin.ca/2331153
I noticed one thing, that my .config changes after the failed compilation. First I thought I forgot to run
./source/scripts/config --disable function_tracer --disable function_graph_tracer --disable stack_tracer --enable lto_menu --disable lto_disable --disable lto_debug --disable lto_slim
but it's being changed during make.
before compile
CONFIG_LTO_MENU=y
# CONFIG_LTO_DISABLE is not set
CONFIG_LTO=y
# CONFIG_LTO_DEBUG is not set
# CONFIG_LTO_CP_CLONE is not set
# CONFIG_LTO_SLIM is not set
# CONFIG_HID_WALTOP is not set
after compile
# grep LTO .config
CONFIG_LTO_MENU=y
# CONFIG_LTO_DISABLE is not set
CONFIG_LTO=y
# CONFIG_LTO_DEBUG is not set
# CONFIG_LTO_CP_CLONE is not set
CONFIG_LTO_SLIM=y
# CONFIG_HID_WALTOP is not set
I think I now know what went wrong -- i forced 3.8 to use slim lto and you didn't specify
AR=gcc-ar
on the make line (pointing to the right gcc-ar for your compiler)
Without that you get exactly that result, as __visible symbols in .a libraries get dropped
If you don't have gcc 4.8 which added gcc-ar you need a ar wrapper script like
#!/bin/sh
ar "$@" --plugin $(gcc47 -print-prog-name=liblto_plugin.so.0)
I'll add a build time check for this case and update the docs
Thanks a lot, that was it, running v3.8.3 + LTO happily now.