This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: CPP predefine conflict with getpc thunks
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: carlos at systemhalted dot org, libc-alpha at sourceware dot org
- Date: Wed, 24 Feb 2010 14:16:40 +0100
- Subject: Re: CPP predefine conflict with getpc thunks
- References: <20100223.194546.120469393.davem@davemloft.net> <119aab441002232040g2ed2d76ev5523b5e2d3ba542e@mail.gmail.com> <20100223.230224.232902682.davem@davemloft.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Feb 23, 2010 at 11:02:24PM -0800, David Miller wrote:
> From: "Carlos O'Donell" <carlos@systemhalted.org>
> Date: Tue, 23 Feb 2010 23:40:56 -0500
>
> > I think we should undef it in the source and include a corresponding
> > comment, or change all instances of __i686 to something else. Having
> > the Makefiles undef a compiler define seems sneaky and bound to bite
> > somebody.
> >
> > Is sysdeps/i386/sysdep.h (SETUP_PIC_REG) the only troublesome spot?
>
> There are also several 10s of *.S assembler files, as well as some
> other header files. Anywhere there is a PIC assembler sequence in the
> x86 code, there will be one of these thunks and thus this problem.
>
> You also can't use a different name, as this is the symbol name that
> the compiler uses for the shared getpc thunks on x86. If we use a
> different name, the instances glibc's assembler uses won't be sharable
> with those emitted by the compiler.
>
> I can't see a way around this other than getting it at the compiler
> command line.
Here is what Fedora branch uses:
2009-07-22 Jakub Jelinek <jakub@redhat.com>
* Makeconfig (ASFLAGS): Append $(sysdep-ASFLAGS).
* sysdeps/i386/Makefile (sysdep-ASFLAGS): Add -U__i686.
--- glibc-2.11-222-ge2f4aa5/Makeconfig
+++ glibc-2.11.90-14/Makeconfig
@@ -780,12 +780,12 @@ endif
# The assembler can generate debug information too.
ifndef ASFLAGS
ifeq ($(have-cpp-asm-debuginfo),yes)
-ASFLAGS := $(filter -g%,$(CFLAGS))
+ASFLAGS = $(filter -g%,$(CFLAGS))
else
-ASFLAGS :=
+ASFLAGS =
endif
endif
-ASFLAGS += $(ASFLAGS-config) $(asflags-cpu)
+ASFLAGS += $(ASFLAGS-config) $(asflags-cpu) $(sysdep-ASFLAGS)
ifndef BUILD_CC
BUILD_CC = $(CC)
--- glibc-2.11-222-ge2f4aa5/sysdeps/i386/Makefile
+++ glibc-2.11.90-14/sysdeps/i386/Makefile
@@ -2,6 +2,8 @@
# Every i386 port in use uses gas syntax (I think).
asm-CPPFLAGS += -DGAS_SYNTAX
+sysdep-ASFLAGS += -U__i686
+
# The i386 `long double' is a distinct type we support.
long-double-fcts = yes
Jakub