riscv: Enable VDSO for static linking
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 29 May 2019 21:48:38 +0000 (18:48 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Aug 2019 19:01:24 +0000 (16:01 -0300)
Checked on riscv64-linux-gnu-rv64imafdc-lp64d qemu system with
some static tests.

[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):
Define.

ChangeLog
sysdeps/unix/sysv/linux/riscv/init-first.c
sysdeps/unix/sysv/linux/riscv/libc-vdso.h
sysdeps/unix/sysv/linux/riscv/sysdep.h

index bd17d9e7e01c43cbf410dde2ce59c280513ed271..bd12f2d60a1fdc54ae320e3dc96c06f7baa1a56a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2019-08-05  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       [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):
+       Define.
+
        * sysdeps/sh/libm-test-ulps: Update.
 
 2019-08-05  Florian Weimer  <fweimer@redhat.com>
index 8134c79695c927260390a39979d11a3357ccad64..98a8ce33adbf0db47729ada25c8b800e07ab1ece 100644 (file)
@@ -17,9 +17,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 (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
@@ -52,7 +51,6 @@ _libc_vdso_platform_setup (void)
   VDSO_SYMBOL (clock_getres) = p;
 }
 
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
+#define VDSO_SETUP _libc_vdso_platform_setup
 
 #include <csu/init-first.c>
index b0c46f3cb7df641b023440ee86cbfd810e29d688..2373292ab9e49465067a150a0dc19ba7801e4156 100644 (file)
@@ -20,9 +20,7 @@
 #ifndef _LIBC_VDSO_H
 #define _LIBC_VDSO_H
 
-#ifdef SHARED
-
-# include <sysdep-vdso.h>
+#include <sysdep-vdso.h>
 
 extern long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
     attribute_hidden;
@@ -33,6 +31,4 @@ extern long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
 extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
     attribute_hidden;
 
-#endif
-
 #endif /* _LIBC_VDSO_H */
index 5470ea3d2a6882ad34e5fc924517fd6fc98add2b..caf013a9a11eef3fa2b6541deb3a3314c2d89090 100644 (file)
@@ -19,6 +19,9 @@
 #ifndef _LINUX_RISCV_SYSDEP_H
 #define _LINUX_RISCV_SYSDEP_H 1
 
+/* Always enable vsyscalls on riscv */
+#define ALWAYS_USE_VSYSCALL 1
+
 #include <sysdeps/unix/sysv/linux/generic/sysdep.h>
 #include <tls.h>