This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC PATCH] glibc doesn't build with "gcc -march=i686"


Greetings,

Attempting to build glibc (cvs) with CC='gcc -march=i686' results in errors:

../sysdeps/i386/fpu/s_frexp.S: Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: unrecognized symbol type ""

This is because gcc defines __i686 to 1 when -march=i686

Attached patch fixes that, but perhaps there is a better way?

Thanks,
-- 
Paul Pluzhnikov

2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * sysdeps/i386/sysdep.h: Undef __i686 before using.
        * sysdeps/i386/i686/memcmp.S: Likewise.
2008-05-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* sysdeps/i386/sysdep.h: Undef __i686 before using.
	* sysdeps/i386/i686/memcmp.S: Likewise.

Index: sysdeps/i386/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/sysdep.h,v
retrieving revision 1.18
diff -u -r1.18 sysdep.h
--- sysdeps/i386/sysdep.h	28 Oct 2006 06:44:03 -0000	1.18
+++ sysdeps/i386/sysdep.h	23 May 2008 21:07:15 -0000
@@ -133,6 +133,8 @@
     cfi_adjust_cfa_offset (-4);						      \
     addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
 
+#undef __i686
+
 # define SETUP_PIC_REG(reg) \
   .ifndef __i686.get_pc_thunk.reg;					      \
   .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;	      \
Index: sysdeps/i386/i686/memcmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/i686/memcmp.S,v
retrieving revision 1.8
diff -u -r1.8 memcmp.S
--- sysdeps/i386/i686/memcmp.S	3 Dec 2006 23:15:10 -0000	1.8
+++ sysdeps/i386/i686/memcmp.S	23 May 2008 21:19:53 -0000
@@ -32,6 +32,8 @@
 			cfi_restore (ebx); LEAVE; ret; \
 			cfi_adjust_cfa_offset (4); cfi_rel_offset (ebx, 0);
 
+#undef __i686
+
 /* Load an entry in a jump table into EBX.  TABLE is a jump table
    with relative offsets.  INDEX is a register contains the index
    into the jump table.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]