From: Rafael Ávila de Espíndola Date: Mon, 10 Dec 2018 21:27:54 +0000 (+0000) Subject: Enable VDSO for static linking on mips X-Git-Tag: glibc-2.29~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ba9eb821c96ae41038460ee1fcd42308e074f2;p=thirdparty%2Fglibc.git Enable VDSO for static linking on mips 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. [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. --- diff --git a/ChangeLog b/ChangeLog index 1d21435858e..e47fbd71192 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2018-12-10 Rafael Ávila de Espíndola + + [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. + 2018-12-10 Florian Weimer [BZ #23972] diff --git a/sysdeps/unix/sysv/linux/mips/init-first.c b/sysdeps/unix/sysv/linux/mips/init-first.c index 0cf8279c73a..2e04a6b0504 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 . */ -#ifdef SHARED -# include -# include +#include +#include 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 diff --git a/sysdeps/unix/sysv/linux/mips/libc-vdso.h b/sysdeps/unix/sysv/linux/mips/libc-vdso.h index c36e22dc400..f8f89fbcf25 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 +#include 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 cbe9cd2bda4..2d6e0234b60 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 #include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h index 8e3117d7a7a..5c8181cd290 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 #include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h index c9046a06b89..7c71d1ed121 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 #include