OpenSDE/package-nopast — Issue #3: glibc failing for i686
Author: morfoh
Created: 2012-03-03 15:58:02+00:00
State: open

glibc is failing at cross-compile stage when building for i686

snippet from the build log:

i686-unknown-linux-gnu-gcc strncpy.c -c -std=gnu99 -fgnu89-inline -DNDEBUG=1 -Wall -Winline -Wwrite-strings -fmerge-all-constants -g -Wstrict-prototypes -mpreferred-stack-boundary=2 -Wa,-mtune=i686 -I../include -I/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string -I/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../ports -I../nptl -I.. -I../libio -I. -nostdinc -isystem /build/morfoh/opensde/0.3-devel/build/desktop-master-desktop-base-x86-pentium2/TOOLCHAIN/tools.cross/crosscc/../lib/gcc/i686-unknown-linux-gnu/4.6.2/include -isystem /build/morfoh/opensde/0.3-devel/build/desktop-master-desktop-base-x86-pentium2/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -o /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strncpy.o -MD -MP -MF /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strncpy.o.dt -MT /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strncpy.o
i686-unknown-linux-gnu-gcc ../sysdeps/i386/strrchr.S -c -I../include -I/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string -I/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux/i386 -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv/i386 -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../ports -I../nptl -I.. -I../libio -I. -nostdinc -isystem /build/morfoh/opensde/0.3-devel/build/desktop-master-desktop-base-x86-pentium2/TOOLCHAIN/tools.cross/crosscc/../lib/gcc/i686-unknown-linux-gnu/4.6.2/include -isystem /build/morfoh/opensde/0.3-devel/build/desktop-master-desktop-base-x86-pentium2/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DASSEMBLER -DGAS_SYNTAX -Wa,--noexecstack -Wa,-mtune=i686 -o /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strrchr.o -MD -MP -MF /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strrchr.o.dt -MT /build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strrchr.o
../sysdeps/i386/i686/multiarch/strcmp.S: Assembler messages:
../sysdeps/i386/i686/multiarch/strcmp.S:90: Error: can't resolve `.text' {.text section} - `strcmp' {.text section}
make[2]: *** [/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strcmp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../sysdeps/i386/i686/multiarch/strcspn.S: Assembler messages:
../sysdeps/i386/i686/multiarch/strcspn.S:87: Error: can't resolve `.text' {.text section} - `strcspn' {.text section}
make[2]: *** [/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/objdir-i686-unknown-linux-gnu/string/strcspn.o] Error 1
strnlen.c: In function '__strnlen':
strnlen.c:34:31: warning: variable 'magic_bits' set but not used [-Wunused-but-set-variable]
make[2]: Leaving directory `/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1/string'
make[1]: *** [string/subdir_lib] Error 2
make[1]: Leaving directory `/build/morfoh/opensde/0.3-devel/src.glibc.desktop.20120303.151056.30575.builder-urr/glibc-2.14.1'
make: *** [all] Error 2

The whole issue seems to be related to multi-arch enabled glibc builds because when disabling multi-arch the package is build succesfully.

The following workaround within `package/glibc/glibc.conf` seems to fit for now for being able to build i686 based targets:

case $arch_machine in
i686) var_append extraconfopt ' ' "--disable-multi-arch" ;;
esac