This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Check __ILP32__ instead of __LP64__
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 13 Apr 2012 15:27:46 -0700
- Subject: PATCH: Check __ILP32__ instead of __LP64__
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
Here are 3 patches to check __ILP32__ instead of __LP64__. They
are tested on Linux/x32 and Linux/x86-64. OK to install?
Thanks.
H.J.
---
>From e1049703b6757f9c33175a98e0759836117292b8 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 13 Apr 2012 14:57:13 -0700
Subject: Check __ILP32__ instead of __LP64__
* elf/tst-auditmod1.c: Check __ILP32__ instead of __LP64__.
* elf/tst-auditmod3b.c: Likewise.
* elf/tst-auditmod4b.c: Likewise.
* elf/tst-auditmod5b.c: Likewise.
* elf/tst-auditmod6b.c: Likewise.
* elf/tst-auditmod6c.c: Likewise.
* elf/tst-auditmod7b.c: Likewise.
diff --git a/elf/tst-auditmod1.c b/elf/tst-auditmod1.c
index 67fc758..108d6de 100644
--- a/elf/tst-auditmod1.c
+++ b/elf/tst-auditmod1.c
@@ -109,7 +109,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
# define La_retval La_i86_retval
# define int_retval lrv_eax
#elif defined __x86_64__
-# ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod3b.c b/elf/tst-auditmod3b.c
index 921eaca..a9bb0e2 100644
--- a/elf/tst-auditmod3b.c
+++ b/elf/tst-auditmod3b.c
@@ -105,7 +105,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod4b.c b/elf/tst-auditmod4b.c
index 75e8558..7778d6a 100644
--- a/elf/tst-auditmod4b.c
+++ b/elf/tst-auditmod4b.c
@@ -94,7 +94,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod5b.c b/elf/tst-auditmod5b.c
index d2443c8..3a42215 100644
--- a/elf/tst-auditmod5b.c
+++ b/elf/tst-auditmod5b.c
@@ -95,7 +95,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod6b.c b/elf/tst-auditmod6b.c
index b00dcd7..a9fe5dc 100644
--- a/elf/tst-auditmod6b.c
+++ b/elf/tst-auditmod6b.c
@@ -94,7 +94,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod6c.c b/elf/tst-auditmod6c.c
index a78c913..9b1063b 100644
--- a/elf/tst-auditmod6c.c
+++ b/elf/tst-auditmod6c.c
@@ -94,7 +94,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+# ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
diff --git a/elf/tst-auditmod7b.c b/elf/tst-auditmod7b.c
index d761149..1ae9e72 100644
--- a/elf/tst-auditmod7b.c
+++ b/elf/tst-auditmod7b.c
@@ -94,7 +94,7 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
return sym->st_value;
}
-#ifdef __LP64__
+#ifndef __ILP32__
# define pltenter la_x86_64_gnu_pltenter
# define pltexit la_x86_64_gnu_pltexit
# define La_regs La_x86_64_regs
--
1.7.6.5
>From e5e29054091f86f9c659715925ac0c5655308401 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 13 Apr 2012 15:06:21 -0700
Subject: PATCH: Check __ILP32__ instead of __LP64__
* sysdeps/x86_64/ffsll.c (ffsl): Check __ILP32__ instead of
__LP64__.
diff --git a/sysdeps/x86_64/ffsll.c b/sysdeps/x86_64/ffsll.c
index a7a5dc8..0c07dce 100644
--- a/sysdeps/x86_64/ffsll.c
+++ b/sysdeps/x86_64/ffsll.c
@@ -36,7 +36,7 @@ ffsll (long long int x)
return cnt + 1;
}
-#ifdef __LP64__
+#ifndef __ILP32__
#undef ffsl
weak_alias (ffsll, ffsl)
#endif
--
1.7.6.5
>From d130bc9860a76bd0c69590bfc42a27cf4540d462 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 13 Apr 2012 15:09:14 -0700
Subject: PATCH: Check __ILP32__ instead of __LP64__
* sysdeps/x86_64/preconfigure.in: Check __ILP32__ instead of
__LP64__
* sysdeps/x86_64/preconfigure: Regenerated.
2012-04-13 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/sysdeps/x86_64/preconfigure b/sysdeps/x86_64/preconfigure
index cdba20a..2fc5871 100644
--- a/sysdeps/x86_64/preconfigure
+++ b/sysdeps/x86_64/preconfigure
@@ -134,7 +134,7 @@ if ${libc_cv_x32+:} false; then :
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#ifdef __LP64__
+#ifndef __ILP32__
# error not x32
#endif
int
diff --git a/sysdeps/x86_64/preconfigure.in b/sysdeps/x86_64/preconfigure.in
index 6cf758c..21e4121 100644
--- a/sysdeps/x86_64/preconfigure.in
+++ b/sysdeps/x86_64/preconfigure.in
@@ -9,7 +9,7 @@ x86_64)
AC_CACHE_CHECK(whether $CC compiles in -mx32 mode by default,
libc_cv_x32, [dnl
AC_TRY_COMPILE(dnl
-[#ifdef __LP64__
+[#ifndef __ILP32__
# error not x32
#endif], [], libc_cv_x32=yes, libc_cv_x32=no)])
if test $libc_cv_x32 = yes; then
--
1.7.6.5