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

943 views Asked by At

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

There are 1 answers

0
aware On

I've been going at it for quite a while and I solved this particular problem by patching ./.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

After that was fixed I had a problem with

[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.

which according to this post: https://sourceware.org/ml/crossgcc/2012-06/msg00023.html was solved by setting CT_ARCH_CPU and CT_ARCH_TUNE to i686.

My crosstool-NG version (crosstool-ng-1.21.0-41-gc45cfb5) shows

Target-options->Tune for CPU

only when

Target-options->Emit assembly for CPU

is empty. I assumed Emit assembly for CPU using mcpu might give me the same results.

To avoid this problem set (as the link above indicates)

Target-options->Emit assembly for CPU

to i686.