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]

[PATCH] x32: Set GLRO(dl_platform) to "x86_64" by default [BZ #22363]


Set dl_platform to "x86_64" for x32 by default since kernel may set it
to "i686".  This fixed:

FAIL: elf/tst-platform-1

on x32.  Tested on x86-64 and x32.

Any comments?

H.J.
---
	[BZ #22363]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
	GLRO(dl_platform) to "x86_64" by default for x32.
---
 sysdeps/x86/cpu-features.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 87aaa8683c..0ca29365ef 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -430,6 +430,11 @@ no_cpuid:
 
       if (platform != NULL)
 	GLRO(dl_platform) = platform;
+# ifdef __ILP32__
+      /* Set dl_platform to "x86_64" since kernel may set it to "i686".  */
+      else
+	GLRO(dl_platform) = "x86_64";
+# endif
     }
 #else
   GLRO(dl_hwcap) = 0;
-- 
2.13.6


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