This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [preliminary patch] Fix build failure with Debian gcc-4.7
On Friday, July 06, 2012 11:00:26 PM Daniel Schepler wrote:
> Here's an updated version, which has the redirections abstracted to a
> couple macros.
OK, as it turned out, that patch completely broke the static build. Here's a
completed first draft of the patch, with which I can build amd64 glibc on
Debian. (It also builds i386 glibc with no changes, since it seems on that
arch, __isnan isn't aliased to __GI___isnan or anything else.)
--
Daniel Schepler
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 12b3639..063b033 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -491,6 +491,11 @@ for linking")
# define __hidden_proto(name, internal, attrs...) \
extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
__hidden_proto_hiddenattr (attrs);
+# define __non_inline_version(name) \
+ __NI_##name
+# define __hidden_proto_non_inline(name, attrs...) \
+ extern __typeof (name) __non_inline_version(name) __attribute__ ((attrs)); \
+ __hidden_proto (__non_inline_version(name), __GI_##name)
# define __hidden_asmname(name) \
__hidden_asmname1 (__USER_LABEL_PREFIX__, name)
# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
@@ -540,6 +545,10 @@ for linking")
#else
# ifndef __ASSEMBLER__
# define hidden_proto(name, attrs...)
+# define __non_inline_version(name) __NI_##name
+# define __hidden_proto_non_inline(name, attrs...) \
+ extern __typeof (name) __non_inline_version(name) \
+ __asm__ (#name) __attribute__ ((attrs));
# else
# define HIDDEN_JUMPTARGET(name) JUMPTARGET(name)
# endif /* Not __ASSEMBLER__ */
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
index f25ede8..8ba49fb 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c
@@ -18,8 +18,10 @@
#include <math_private.h>
#undef __finite
+__hidden_proto_non_inline (__finite, __nothrow__, __const__)
+
int
-__finite(double x)
+__non_inline_version(__finite) (double x)
{
int64_t lx;
EXTRACT_WORDS64(lx,x);
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
index 70a620c..91a2dea 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_isnan.c
@@ -19,7 +19,9 @@
#include <math_private.h>
#undef __isnan
-int __isnan(double x)
+__hidden_proto_non_inline (__isnan, __nothrow__, __const__)
+
+int __non_inline_version(__isnan) (double x)
{
int64_t hx;
EXTRACT_WORDS64(hx,x);
diff --git a/sysdeps/ieee754/flt-32/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c
index dfdf4ad..4d74521 100644
--- a/sysdeps/ieee754/flt-32/s_finitef.c
+++ b/sysdeps/ieee754/flt-32/s_finitef.c
@@ -26,7 +26,9 @@ static char rcsid[] = "$NetBSD: s_finitef.c,v 1.4 1995/05/10 20:47:18 jtc Exp $"
#include <math_private.h>
#undef __finitef
-int __finitef(float x)
+__hidden_proto_non_inline (__finitef, __nothrow__, __const__)
+
+int __non_inline_version(__finitef) (float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/sysdeps/ieee754/flt-32/s_isnanf.c b/sysdeps/ieee754/flt-32/s_isnanf.c
index 820b31a..961f93e 100644
--- a/sysdeps/ieee754/flt-32/s_isnanf.c
+++ b/sysdeps/ieee754/flt-32/s_isnanf.c
@@ -26,7 +26,9 @@ static char rcsid[] = "$NetBSD: s_isnanf.c,v 1.4 1995/05/10 20:47:38 jtc Exp $";
#include <math_private.h>
#undef __isnanf
-int __isnanf(float x)
+__hidden_proto_non_inline (__isnanf, __nothrow__, __const__)
+
+int __non_inline_version(__isnanf) (float x)
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
diff --git a/sysdeps/x86_64/fpu/fraiseexcpt.c b/sysdeps/x86_64/fpu/fraiseexcpt.c
index ab28b85..259b196 100644
--- a/sysdeps/x86_64/fpu/fraiseexcpt.c
+++ b/sysdeps/x86_64/fpu/fraiseexcpt.c
@@ -116,5 +116,6 @@ __feraiseexcept (int excepts)
/* Success. */
return 0;
}
-strong_alias (__feraiseexcept, feraiseexcept)
+__hidden_proto_non_inline (feraiseexcept)
+strong_alias (__feraiseexcept, __non_inline_version(feraiseexcept))
libm_hidden_def (feraiseexcept)