public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] s390: Enable VDSO for static linking
Date: Mon, 05 Aug 2019 19:45:00 -0000	[thread overview]
Message-ID: <20190805194534.45062.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5e855c8954014bca7b0d6f07312ec09553695ffd

commit 5e855c8954014bca7b0d6f07312ec09553695ffd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu May 30 08:04:06 2019 -0300

    s390: Enable VDSO for static linking
    
    Although s390 only enables vDSO for dynamically linked elf binaries
    (arch/s390/kernel/vdso.c:217), there is no indication in the code or
    associated commit message for why not enable it for statically linked
    binaries as well.  To double check, I rebuilt a kernel with the
    check removed and the vDSO does work for static build for supplied
    symbols.
    
    Checked on s390x-linux-gnu and s390-linux-gnu.
    
    	[BZ #19767]
    	* sysdeps/unix/sysv/linux/s390/init-first.c: Remove #ifdef SHARED.
    	* sysdeps/unix/sysv/linux/s390/libc-vdso.h: Likewise.
    	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
    	(ALWAYS_USE_VSYSCALL): Define.
    	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
    	(ALWAYS_USE_VSYSCALL): Likewise.

Diff:
---
 ChangeLog                                     | 8 ++++++++
 sysdeps/unix/sysv/linux/s390/init-first.c     | 8 ++------
 sysdeps/unix/sysv/linux/s390/libc-vdso.h      | 3 ---
 sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 3 +++
 sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 3 +++
 5 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bd12f2d..c9d7631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
 2019-08-05  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	[BZ #19767]
+	* sysdeps/unix/sysv/linux/s390/init-first.c: Remove #ifdef SHARED.
+	* sysdeps/unix/sysv/linux/s390/libc-vdso.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+	(ALWAYS_USE_VSYSCALL): Define.
+	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+	(ALWAYS_USE_VSYSCALL): Likewise.
+
+	[BZ #19767]
 	* sysdeps/unix/sysv/linux/riscv/init-first.c: Remove #ifdef SHARED.
 	* sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
 	* sysdeps/unix/sysv/linux/riscv/sysdep.h (ALWAYS_USE_VSYSCALL):
diff --git a/sysdeps/unix/sysv/linux/s390/init-first.c b/sysdeps/unix/sysv/linux/s390/init-first.c
index 1f46e80..8c54d13 100644
--- a/sysdeps/unix/sysv/linux/s390/init-first.c
+++ b/sysdeps/unix/sysv/linux/s390/init-first.c
@@ -16,9 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
-# include <dl-vdso.h>
-# include <libc-vdso.h>
+#include <dl-vdso.h>
+#include <libc-vdso.h>
 
 long int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
    attribute_hidden;
@@ -54,7 +53,4 @@ _libc_vdso_platform_setup (void)
   VDSO_SYMBOL (getcpu) = p;
 }
 
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
-
 #include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/s390/libc-vdso.h b/sysdeps/unix/sysv/linux/s390/libc-vdso.h
index 5e2d1e4..cc97601 100644
--- a/sysdeps/unix/sysv/linux/s390/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/s390/libc-vdso.h
@@ -20,8 +20,6 @@
 #ifndef _LIBC_VDSO_H
 #define _LIBC_VDSO_H
 
-#ifdef SHARED
-
 #include <sysdep-vdso.h>
 
 extern long int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
@@ -33,6 +31,5 @@ extern long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
 
 extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
    attribute_hidden;
-#endif
 
 #endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 640fb52..47d1c5c 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
@@ -19,6 +19,9 @@
 #ifndef _LINUX_S390_SYSDEP_H
 #define _LINUX_S390_SYSDEP_H
 
+/* Always enable vsyscalls on s390-32.  */
+#define ALWAYS_USE_VSYSCALL 1
+
 #include <sysdeps/s390/s390-32/sysdep.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
index 9a9834c..2552aaa 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
@@ -20,6 +20,9 @@
 #ifndef _LINUX_S390_SYSDEP_H
 #define _LINUX_S390_SYSDEP_H
 
+/* Always enable vsyscalls on s390-64.  */
+#define ALWAYS_USE_VSYSCALL 1
+
 #include <sysdeps/s390/s390-64/sysdep.h>
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/unix/sysv/linux/sysdep.h>


                 reply	other threads:[~2019-08-05 19:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190805194534.45062.qmail@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).