[commited] x86_64: Fix build with RTLD_PRIVATE_ERRNO defined to 1

Message ID 20180318011254.1126-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series
  • [commited] x86_64: Fix build with RTLD_PRIVATE_ERRNO defined to 1
Related show

Commit Message

Samuel Thibault March 18, 2018, 1:12 a.m.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Always include
	<dl-sysdep.h>.  Test for value of RTLD_PRIVATE_ERRNO instead of
	testing whether it is defined.
---
 ChangeLog                               | 3 +++
 sysdeps/unix/sysv/linux/x86_64/sysdep.h | 7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)

-- 
2.16.2

Comments

Samuel Thibault March 18, 2018, 1:16 a.m. | #1
Sorry, that fixes the build when RTLD_PRIVATE_ERRNO is defined to 0.
Being defined to 1 is the usual cases which is building fine of course.

Samuel

Patch

diff --git a/ChangeLog b/ChangeLog
index 2fe1850e21..b9f90147f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -100,6 +100,9 @@ 
 	cthread_setspecific.
 	* sysdeps/mach/libc-lock.h (__libc_key_create, __libc_setspecific):
 	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Always include
+	<dl-sysdep.h>.  Test for value of RTLD_PRIVATE_ERRNO instead of
+	testing whether it is defined.
 
 2018-03-16  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index b9b9bf9cd3..1ef0f742ae 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -23,9 +23,8 @@ 
 #include <sysdeps/unix/x86_64/sysdep.h>
 #include <tls.h>
 
-#if IS_IN (rtld)
-# include <dl-sysdep.h>		/* Defines RTLD_PRIVATE_ERRNO.  */
-#endif
+/* Defines RTLD_PRIVATE_ERRNO.  */
+#include <dl-sysdep.h>
 
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
@@ -110,7 +109,7 @@ 
 
 # define ret_ERRVAL ret
 
-# if defined PIC && defined RTLD_PRIVATE_ERRNO
+# if defined PIC && RTLD_PRIVATE_ERRNO
 #  define SYSCALL_SET_ERRNO			\
   lea rtld_errno(%rip), %RCX_LP;		\
   neg %eax;					\