This is the mail archive of the
mailing list for the glibc project.
Re: -fno-inline-functions vs glibc's initfini
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, libc-alpha at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Tue, 31 Jan 2012 13:50:30 -0600
- Subject: Re: -fno-inline-functions vs glibc's initfini
- References: <firstname.lastname@example.org><20120131191312.3FA292C0AF@topped-with-meat.com>
On Tue, Jan 31, 2012 at 1:13 PM, Roland McGrath <email@example.com> wrote:
> From Richard's response it sounds like there is an easy fix that's
> compatible with both old and new GCC (-fno-inline). ÂI think we can do that
> right away without trouble, and get it onto release branches too.
> On the libc side more generally, I've become skeptical that the generic C
> version of initfini is worth continuing with. Â(I say this as the person
> who chose to do it that way in the first place.) ÂThese sorts of things
> always come up again and again. ÂIt's just damn little assembly code to
> write for each machine so you get it exactly right and need not worry about
> what next year's compiler does.
I've been carrying the following patch in my ibm/ branches for a while
due to us hitting something similar earlier last year.Â I'm not
opposed to working out a machine specific version.Â I'll have one of
my guys draft up a proof of concept for PowerPC.
Author: Ryan S. Arnold <firstname.lastname@example.org>
Date:ÂÂ Tue May 3 17:26:17 2011 -0500
ÂÂÂ Prevent erroneous inline optimization of initfini.s on PowerPC64.
diff --git a/ChangeLog b/ChangeLog
index 66482ff..5913162 100644
@@ -1,3 +1,9 @@
+2011-05-03Â Ryan S. ArnoldÂ <email@example.com>
+ÂÂÂÂÂÂ * sysdeps/powerpc/powerpc64/Makefile (CFLAGS-initfini.s): Add
+ÂÂÂÂÂÂ -fno-inline to prevent potential erroneous optimization where init is
+ÂÂÂÂÂÂ inlined to branch directly to fini.
Â2011-02-23Â Andreas SchwabÂ <firstname.lastname@example.org>
ÂÂÂÂÂÂÂÂÂÂÂ Ulrich DrepperÂ <email@example.com>
diff --git a/sysdeps/powerpc/powerpc64/Makefile
index 78d4f07..fe96aae 100644
@@ -28,7 +28,7 @@ elide-routines.os += hp-timing
Â# The initfini generation code doesn't work in the presence of -fPIC, so
Â# we use -fpic instead which is much better.
-CFLAGS-initfini.s += -fpic -O1
+CFLAGS-initfini.s += -fpic -O1 -fno-inline