Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 131108 - glibc fails to compile .S files due to gcc defining __i686
Summary: glibc fails to compile .S files due to gcc defining __i686
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Gentoo Toolchain Maintainers
URL: http://sourceware.org/ml/libc-alpha/2...
Whiteboard:
Keywords:
: 85450 213077 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-24 08:35 UTC by Thomas
Modified: 2008-08-20 02:14 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Output of emerge --info (emerge.info,2.14 KB, text/plain)
2006-04-24 15:24 UTC, Thomas
Details
1130_all_glibc-2.4-undefine-__i686.patch (1130_all_glibc-2.4-undefine-__i686.patch,1.31 KB, patch)
2006-04-25 16:22 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas 2006-04-24 08:35:43 UTC
+++ This bug was initially created as a clone of Bug #85450 +++

The problem does not depend on the gcc version and is not a gcc bug.  It also appears with gcc-3.4.5-r1 and glibc-2.3.5 on my system.

The setjmp.S file (among others) contains a variable or label named __i686, which is #define'd to be 1 if gcc compiles for i686 and up (-march=pentium2 etc.).

The subsequent patch undefines __i686 for assembler files and thus solves the problem.  It should not harm on any other platform.

--- Makeconfig~ Wed Feb 16 11:50:19 2005
+++ Makeconfig  Sun Nov  6 18:39:08 2005
@@ -364,7 +364,7 @@
 # directives the preprocessor produces.  If you have troubling compiling
 # assembly code, try using -P here to suppress these directives.
 ifndef asm-CPPFLAGS
-asm-CPPFLAGS =
+asm-CPPFLAGS = -U__i686
 endif
 
 # ELF always supports init/fini sections


Original bug description:

I've applied 'fixes' for similar gcc-4 bugs but the error doesn't even change.
this occurred with fresh stage and a gcc-3.3 box, both p3's. the jan.18 build idetical ebuilds for p3s on p4 without error and can build nptlonly or nptl for p4 and prescott.

make[2]: Entering directory `/var/tmp/portage/glibc-2.3.4.20050125-r1/work/glibc-2.3.4/setjmp'
i686-pc-linux-gnu-gcc ../sysdeps/i386/elf/setjmp.S -c  -I../include -I. -I/var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl/setjmp -I.. -I../libio -I../nptl -I/var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl -I../sysdeps/i386/elf -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../nptl/sysdeps/unix/sysv -I../nptl/sysdeps/unix -I../nptl/sysdeps/i386/i686 -I../nptl/sysdeps/i386 -I../libidn/sysdeps/unix -I../sysdeps/unix/sysv/linux/i386 -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv/i386 -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -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 -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/include -isystem /usr/include -D_LIBC_REENTRANT -D_LIBC_REENTRANT -include ../include/libc-symbols.h       -DASSEMBLER  -DGAS_SYNTAX  -Wa,--noexecstack  -o /var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl/setjmp/setjmp.o -MD -MP -MF /var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl/setjmp/setjmp.o.dt -MT /var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl/setjmp/setjmp.o
../sysdeps/i386/elf/setjmp.S: Assembler messages:
../sysdeps/i386/elf/setjmp.S:63: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/elf/setjmp.S:64: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/elf/setjmp.S:65: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/elf/setjmp.S:66: Error: unrecognized symbol type ""
../sysdeps/i386/elf/setjmp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/elf/setjmp.S:67: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/elf/setjmp.S:70: Error: expected comma after name `' in .size directive
make[2]: *** [/var/tmp/portage/glibc-2.3.4.20050125-r1/work/build-default-i686-pc-linux-gnu-nptl/setjmp/setjmp.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20050125-r1/work/glibc-2.3.4/setjmp'
make[1]: *** [setjmp/subdir_lib] Error 2
make[1]: Leaving directory `/var/tmp/portage/glibc-2.3.4.20050125-r1/work/glibc-2.3.4'
make: *** [all] Error 2
Comment 1 SpanKY gentoo-dev 2006-04-24 08:52:11 UTC
you forgot to post `emerge info`
Comment 2 Thomas 2006-04-24 15:24:59 UTC
Created attachment 85386 [details]
Output of emerge --info

As you might see from the versions of the packages, this box is largely unfinished and yet to be set up completely.  It is in fact a dual P-3 machine.
Comment 3 SpanKY gentoo-dev 2006-04-24 17:49:14 UTC
the question is, why doesnt this bug show up for a lot more people ...
Comment 4 SpanKY gentoo-dev 2006-04-24 20:23:57 UTC
it's because .S files are not compiled with optimization flags (like -march=i686)

so why is yours being optimized ?  post the output of `emerge -v --info` please
Comment 5 Thomas 2006-04-25 05:29:09 UTC
I have compiled gcc --with-arch=pentium3, so pentium3 is its default architecture and __i686 is always set, also when compiling .S files.

I suppose, most people don't compile glibc with processor specific optimizations.
Comment 6 SpanKY gentoo-dev 2006-04-25 05:47:03 UTC
> I suppose, most people don't compile glibc with processor specific
> optimizations.

no ... the glibc build system ignores optimizations for .S files since they dont really make any sense
Comment 7 SpanKY gentoo-dev 2006-04-25 16:22:58 UTC
Created attachment 85500 [details, diff]
1130_all_glibc-2.4-undefine-__i686.patch

try this instead ... seems to work for me
Comment 8 SpanKY gentoo-dev 2006-04-25 22:12:53 UTC
patch added to 2.4-r2
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2008-03-12 15:00:16 UTC
*** Bug 213077 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2008-03-13 22:21:59 UTC
*** Bug 85450 has been marked as a duplicate of this bug. ***
Comment 11 SpanKY gentoo-dev 2008-08-20 02:14:05 UTC
*** Bug 234381 has been marked as a duplicate of this bug. ***
Comment 12 SpanKY gentoo-dev 2008-08-20 02:14:16 UTC
*** Bug 213077 has been marked as a duplicate of this bug. ***