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]

[preliminary patch] Fix build failure with Debian gcc-4.7


As posted in BZ#14281, glibc (git master) fails to build in Debian sid amd64 
using gcc-4.7.  I've traced it to Debian applying the patch from 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33763#c31 .

It seems the GCC developers aren't agreed on what the exact behavior should be 
if an __always_inline__ definition is followed by a non-inline definition.  The 
attached patch is an update for s_isnan.c to make it a bit more robust with 
regards to this -- it uses a separate name for the offline version of __isnan, 
rather than trying to reuse the name __isnan.  It generates the same asm 
afaict as the unpatched version using Debian gcc-4.6 (which doesn't include 
pr33763.diff), and Debian gcc-4.7 also generates roughly the same asm with the 
patched version.

This is mostly a request for comments on the patch, and definitely not the final 
version of the patch, since I'd have to do the same thing in several more files 
before glibc will build.  In particular, the additional lines should probably 
be declared as a macro, but I have no idea where the best place would be to 
define that macro.
-- 
Daniel Schepler
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index 70a620c..b237a62 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -19,7 +19,10 @@
 #include <math_private.h>
 
 #undef __isnan
-int __isnan(double x)
+extern __typeof(__isnan) __isnan_offline __attribute__ ((__nothrow__, __const__));
+__hidden_proto (__isnan_offline, __GI___isnan)
+
+int __isnan_offline(double x)
 {
 	int64_t hx;
 	EXTRACT_WORDS64(hx,x);

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