public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Enable VDSO for static linking on mips
@ 2018-12-07  5:49 Rafael Ávila de Espíndola
  2018-12-10 22:02 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Ávila de Espíndola @ 2018-12-07  5:49 UTC (permalink / raw)
  To: libc-alpha; +Cc: mips32r2, michael.kostylev, Rafael Avila de Espindola

From: Rafael Avila de Espindola <rafael@espindo.la>

I have tested that this builds and the resulting program still work.

This was tested on gcc23.fsffrance.org, and for some reason the vdso
there seems unused even when using shared libraries.

2018-12-06  Rafael Ávila de Espíndola <rafael@espindo.la>

	[BZ #19767]
	* sysdeps/unix/sysv/linux/mips/init-first.c: Remove #ifdef SHARED.
        * sysdeps/unix/sysv/linux/mips/libc-vdso.h: Remove #ifdef SHARED.
        * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: Define ALWAYS_USE_VSYSCALL.
        * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: Define ALWAYS_USE_VSYSCALL.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: Define ALWAYS_USE_VSYSCALL.
---
 sysdeps/unix/sysv/linux/mips/init-first.c        | 8 +++-----
 sysdeps/unix/sysv/linux/mips/libc-vdso.h         | 6 +-----
 sysdeps/unix/sysv/linux/mips/mips32/sysdep.h     | 3 +++
 sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h | 3 +++
 sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h | 3 +++
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/mips/init-first.c b/sysdeps/unix/sysv/linux/mips/init-first.c
index 0cf8279c73..2e04a6b050 100644
--- a/sysdeps/unix/sysv/linux/mips/init-first.c
+++ b/sysdeps/unix/sysv/linux/mips/init-first.c
@@ -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>
 
 int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
 int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
@@ -38,7 +37,6 @@ _libc_vdso_platform_setup (void)
   VDSO_SYMBOL (clock_gettime) = p;
 }
 
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
+#define VDSO_SETUP _libc_vdso_platform_setup
 
 #include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/mips/libc-vdso.h b/sysdeps/unix/sysv/linux/mips/libc-vdso.h
index c36e22dc40..f8f89fbcf2 100644
--- a/sysdeps/unix/sysv/linux/mips/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/mips/libc-vdso.h
@@ -20,14 +20,10 @@
 #ifndef _LIBC_VDSO_H
 #define _LIBC_VDSO_H
 
-#ifdef SHARED
-
-# include <sysdep-vdso.h>
+#include <sysdep-vdso.h>
 
 extern int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
    attribute_hidden;
 extern int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
 
-#endif
-
 #endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
index cbe9cd2bda..7c751dbe73 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
@@ -18,6 +18,9 @@
 #ifndef _LINUX_MIPS_MIPS32_SYSDEP_H
 #define _LINUX_MIPS_MIPS32_SYSDEP_H 1
 
+/* Always enable vsyscalls on mips32 */
+#define ALWAYS_USE_VSYSCALL 1
+
 /* There is some commonality.  */
 #include <sysdeps/unix/sysv/linux/sysdep.h>
 #include <sysdeps/unix/mips/mips32/sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index 8e3117d7a7..c8fa401ede 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -18,6 +18,9 @@
 #ifndef _LINUX_MIPS_SYSDEP_H
 #define _LINUX_MIPS_SYSDEP_H 1
 
+/* Always enable vsyscalls on n32 */
+#define ALWAYS_USE_VSYSCALL 1
+
 /* There is some commonality.  */
 #include <sysdeps/unix/sysv/linux/sysdep.h>
 #include <sysdeps/unix/mips/mips64/n32/sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index c9046a06b8..d07b0046a9 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -18,6 +18,9 @@
 #ifndef _LINUX_MIPS_SYSDEP_H
 #define _LINUX_MIPS_SYSDEP_H 1
 
+/* Always enable vsyscalls on n64 */
+#define ALWAYS_USE_VSYSCALL 1
+
 /* There is some commonality.  */
 #include <sysdeps/unix/sysv/linux/sysdep.h>
 #include <sysdeps/unix/mips/mips64/n64/sysdep.h>
-- 
2.19.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Enable VDSO for static linking on mips
  2018-12-07  5:49 [PATCH] Enable VDSO for static linking on mips Rafael Ávila de Espíndola
@ 2018-12-10 22:02 ` Joseph Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2018-12-10 22:02 UTC (permalink / raw)
  To: Rafael Ávila de Espíndola
  Cc: libc-alpha, mips32r2, michael.kostylev

Thanks, committed.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-10 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07  5:49 [PATCH] Enable VDSO for static linking on mips Rafael Ávila de Espíndola
2018-12-10 22:02 ` Joseph Myers

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).