Bug 4507

Summary: sysv/linux/i386/sysdep.h problems with asm-preproc that define __i686
Product: glibc Reporter: Paul Eggert <eggert>
Component: libcAssignee: Ulrich Drepper <drepper.fsp>
Status: RESOLVED DUPLICATE    
Severity: normal CC: glibc-bugs, toolchain, wbrana
Priority: P2 Flags: fweimer: security-
Version: 2.4   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: patch for __i686 problem in sysdeps.h
revised __i686 patch, which simply undefs the symbol
revised __i686 patch, which simply undefs the symbol
patch for x86_64
patch for glibc 2.8

Description Paul Eggert 2007-05-14 19:17:51 UTC
An old bug-glibc message for glibc 2.3.1
<http://lists.gnu.org/archive/html/bug-glibc/2003-01/msg00016.html> seemingly
didn't get followed up on.  Simon Poole reported a similar problem for a
crosstool build; see <http://sourceware.org/ml/crossgcc/2004-11/msg00013.html>.

The problem is that an __asm__ generates code containing the symbol __i686, but
some preprocessor/compiler combinations automatically #define __i686 to 1, which
messes up the generated code.

On 2004-05-17 a similar problem was fixed in
sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h by renaming the affected symbol;
see
<http://cvs.savannah.gnu.org/viewvc/libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h?root=libc&r1=1.13&r2=1.14>.
I'll attach a similar (but untested) patch for
sysdeps/unix/sysv/linux/i386/sysdep.h.
Comment 1 Paul Eggert 2007-05-14 19:18:25 UTC
Created attachment 1838 [details]
patch for __i686 problem in sysdeps.h
Comment 2 Ulrich Drepper 2007-05-14 19:41:38 UTC
I have told people several times: __i686.get_pc_thunk.cx is the name of the
section gcc uses.  There is no changing this here.
Comment 3 Paul Eggert 2007-05-15 14:38:49 UTC
Created attachment 1839 [details]
revised __i686 patch, which simply undefs the symbol

OK, thanks, I didn't know the symbol couldn't be changed.  In that case, Wolf's
original patch seems apropos and I have attached it, replacing the incorrect
patch.
Comment 4 Paul Eggert 2007-05-15 14:41:14 UTC
Created attachment 1840 [details]
revised __i686 patch, which simply undefs the symbol

Fix misspelling in comment.
Comment 5 Ulrich Drepper 2007-11-08 00:00:34 UTC
*** Bug 5283 has been marked as a duplicate of this bug. ***
Comment 6 Mike Frysinger 2007-12-10 01:01:32 UTC
this isnt a linux-specific issue is it ?  in other words, shouldnt the change be
done in sysdeps/i386/sysdep.h ?
Comment 7 wbrana 2007-12-19 20:25:24 UTC
Created attachment 2151 [details]
patch for x86_64
Comment 8 wbrana 2008-08-10 15:06:41 UTC
Created attachment 2899 [details]
patch for glibc 2.8
Comment 9 Rafa&#322; Rzepecki 2009-12-21 05:05:19 UTC
Still broken as of f01c2359ebd4ed130ea0bfa67b59db896cb55cd5. Patch in attachment
1840 [details] fixes the problem.
Comment 10 Joseph Myers 2012-02-18 00:16:39 UTC
This was fixed as bug 411.

*** This bug has been marked as a duplicate of bug 411 ***