crosstool-NG linux x86 32Bit build fails on 32Bit vm-machine, Assembler messages

时间:2015-06-15 15:00:34

标签: linux gcc glibc toolchain crosstool-ng

We want to compile a defined linux x86 32Bit toolchain using crosstool-NG ct-ng:

glibc 2.9
gcc 4.8.4

I am using an ubuntu 14.04 32Bit:
Linux ubuntu 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:45:15 UTC 2015 i686 i686 i686 GNU/Linux.

crosstool-NG fails with:
Build failed in step 'Installing C library headers & start files'

while compiling

/home/user/crosstool-x86-linux-32/.build/i386-unknown-linux-gnu/build/build-libc-startfiles/csu/crtn.o

It fails with a couple of Assembler messanges:

[ALL ] /tmp/ccCj5ny0.s: Assembler messages: [ALL ] /tmp/ccCj5ny0.s:92: Error: can't resolve .LFE8' {*UND* section} -.LFB8' {UND section} (and error similar to that...)
Before that particular problem we were bumping into a similar problem

../sysdeps/generic/initfini.c: Assembler messages: ../sysdeps/generic/initfini.c:123: Error: open CFI at the end of file; missing .cfi_endproc directive ../sysdeps/generic/initfini.c:123: Error: open CFI at the end of file; missing .cfi_endproc directive

we temporarily "fixed" the error using "-fno-dwarf2-cfi-asm" in the target/host/build cflags found in this post http://www.openwall.com/lists/owl-dev/2011/10/18/4 .

which lead us here...

I'd love to know what the source of this error is except for the glibc being to old (which it probably is...).

See attachments for .config and build.log of ct-ng. http://s000.tinyupload.com/download.php?file_id=60582934753963239188&t=6058293475396323918817262

1 个答案:

答案 0 :(得分:1)

我已经进行了很长一段时间,我通过修补解决了这个特殊问题./。build / src / glibc-2.9 / sysdeps / i386 / Makefile:

ifeq ($(subdir),csu)
CFLAGS-initfini.s += -fno-unwind-tables -fno-asynchronous-unwind-tables
endif

ifeq ($(subdir),nptl)
CFLAGS-pt-initfini.s += -fno-unwind-tables -fno-asynchronous-unwind-tables
endif

在修复之后我遇到了问题

[ALL  ]    make[3]: *** No rule to make target `.build/i386-unknown-linux-gnu/build/build-libc-final/nptl/pthread_spin_trylock.o', needed by `lib-noranlib'.  Stop.

根据这篇文章: https://sourceware.org/ml/crossgcc/2012-06/msg00023.html 通过将CT_ARCH_CPU和CT_ARCH_TUNE设置为i686来解决。

我的crosstool-NG版本(crosstool-ng-1.21.0-41-gc45cfb5)显示

Target-options->Tune for CPU

仅在

Target-options->Emit assembly for CPU

是空的。我假设使用 mcpu CPU发送汇编可能会给我相同的结果。

要避免此问题集(如上面的链接所示)

Target-options->Emit assembly for CPU

到i686。