This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Arch maintainers: new approach for crti.o and crtn.o
- From: David Miller <davem at davemloft dot net>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org, libc-ports at sourceware dot org
- Date: Fri, 10 Feb 2012 15:22:48 -0500 (EST)
- Subject: Re: Arch maintainers: new approach for crti.o and crtn.o
- References: <Pine.LNX.4.64.1202080145470.4538@digraph.polyomino.org.uk>
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Wed, 8 Feb 2012 01:56:03 +0000 (UTC)
> glibc now supports building crti.o and crtn.o (both the csu/ versions and
> the nptl/ versions) from .S files, instead of the very fragile approach
> (which kept breaking with GCC changes) of postprocessing .s output from
> initfini.c and pt-initfini.c to separate function prologues and epilogues
> into separate files.
Joseph, I have this almost done for sparc but I've run into one snag.
Sparc needs "-fPIC" specified when turning assembler files into objects,
because this changes what relocations are generated. For example, for
a call instruction R_SPARC_WDISP30 is generated for non-PIC vs.
R_SPARC_WPLT30 for PIC.
This worked beforehand because we go "ASFLAGS-.os = -fPIC" in the
Sparc Makefile fragments.
However, the csu/ and nptl/ Makefile fragments now do the
"$(ASFLAGS-.os)" thing only in the backwards compatability case. I
need it to happen unconditionally whenever we build crt{i,n}.o and
related objects (such as pt-crti.o).
Is there any particular reason you hid the ASFLAGS stuff exclusively
into the backwards compat case? I guess it's to deal with the "defs.h"
dependency which doesn't exist when crt{i,n}.S are provided by the
architecture.