linux: Enable vDSO for static linking as default (BZ#19767)

This patch assumes static vDSO is supported as default, it is now supported
on all current architectures that support vDSO.  It allows removing both
ALWAYS_USE_VSYSCALL define, which an architecture requires to explicit define
and USE_VSYSCALL (which defines vDSO only for shared or if architecture defines
ALWAYS_USE_VSYSCALL).

Checked with a build against all affected ABIs.

	[BZ #19767]
	* sysdeps/unix/sysv/linux/aarch64/sysdep.h (ALWAYS_USE_VSYSCALL):
	Remove definition.
	* sysdeps/unix/sysv/linux/arm/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/riscv/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
	(ALWAYS_USE_VSYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (ALWAYS_USE_VSYSCALL):
	Likewise.
	* sysdeps/unix/sysv/linux/x86/libc-vdso.h: Remove #if USE_VSYSCALL.
	* sysdeps/unix/sysv/linux/sysdep-vdso.h: Likewise.
	* sysdeps/unix/sysv/linux/sysdep.h (ALWAYS_USE_VSYSCALL,
	USE_VSYSCALL): Remove defitions.
This commit is contained in:
Adhemerval Zanella 2019-06-13 20:00:29 +00:00
parent c9c1a413c0
commit d665367f59
17 changed files with 34 additions and 52 deletions

View File

@ -1,5 +1,37 @@
2019-08-05 Adhemerval Zanella <adhemerval.zanella@linaro.org>
[BZ #19767]
* sysdeps/unix/sysv/linux/aarch64/sysdep.h (ALWAYS_USE_VSYSCALL):
Remove definition.
* sysdeps/unix/sysv/linux/arm/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/riscv/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
(ALWAYS_USE_VSYSCALL): Likewise.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (ALWAYS_USE_VSYSCALL):
Likewise.
* sysdeps/unix/sysv/linux/x86/libc-vdso.h: Remove #if USE_VSYSCALL.
* sysdeps/unix/sysv/linux/sysdep-vdso.h: Likewise.
* sysdeps/unix/sysv/linux/sysdep.h (ALWAYS_USE_VSYSCALL,
USE_VSYSCALL): Remove defitions.
[BZ #19767]
* sysdeps/unix/sysv/linux/sparc/init-first.c: Remove #ifdef SHARED.
* sysdeps/unix/sysv/linux/sparc/libc-vdso.h: Likewise.

View File

@ -19,9 +19,6 @@
#ifndef _LINUX_AARCH64_SYSDEP_H
#define _LINUX_AARCH64_SYSDEP_H 1
/* Always enable vsyscalls on aarch64 */
#define ALWAYS_USE_VSYSCALL 1
#include <sysdeps/unix/sysdep.h>
#include <sysdeps/aarch64/sysdep.h>
#include <sysdeps/unix/sysv/linux/generic/sysdep.h>

View File

@ -20,9 +20,6 @@
#ifndef _LINUX_ARM_SYSDEP_H
#define _LINUX_ARM_SYSDEP_H 1
/* Always enable vsyscalls on arm */
#define ALWAYS_USE_VSYSCALL 1
/* There is some commonality. */
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/arm/sysdep.h>

View File

@ -19,9 +19,6 @@
#ifndef _LINUX_I386_SYSDEP_H
#define _LINUX_I386_SYSDEP_H 1
/* Always enable vsyscalls on i386 */
#define ALWAYS_USE_VSYSCALL 1
/* There is some commonality. */
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/i386/sysdep.h>

View File

@ -18,9 +18,6 @@
#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>

View File

@ -18,9 +18,6 @@
#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>

View File

@ -18,9 +18,6 @@
#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>

View File

@ -18,9 +18,6 @@
#ifndef _LINUX_POWERPC_SYSDEP_H
#define _LINUX_POWERPC_SYSDEP_H 1
/* Always enable vsyscalls on powerpc32 */
#define ALWAYS_USE_VSYSCALL 1
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/powerpc/sysdep.h>
#include <tls.h>

View File

@ -20,9 +20,6 @@
#ifndef _LINUX_POWERPC_SYSDEP_H
#define _LINUX_POWERPC_SYSDEP_H 1
/* Always enable vsyscalls on powerpc64 */
#define ALWAYS_USE_VSYSCALL 1
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/powerpc/sysdep.h>
#include <tls.h>

View File

@ -19,9 +19,6 @@
#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>

View File

@ -19,9 +19,6 @@
#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>

View File

@ -20,9 +20,6 @@
#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>

View File

@ -19,9 +19,6 @@
#ifndef _LINUX_SPARC_SYSDEP_H
#define _LINUX_SPARC_SYSDEP_H 1
/* Always enable vsyscalls on sparc */
#define ALWAYS_USE_VSYSCALL 1
#include <sysdeps/unix/sysdep.h>
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/sparc/sysdep.h>

View File

@ -26,7 +26,7 @@
funcptr (args)
#endif
#if USE_VSYSCALL && defined HAVE_VSYSCALL
#ifdef HAVE_VSYSCALL
# include <libc-vdso.h>

View File

@ -18,13 +18,6 @@
#include <bits/wordsize.h>
#include <kernel-features.h>
/* By default only shared builds use vdso. */
#ifndef ALWAYS_USE_VSYSCALL
#define ALWAYS_USE_VSYSCALL 0
#endif
#define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)
/* Set error number and return -1. A target may choose to return the
internal function, __syscall_error, which sets errno and returns -1.
We use -1l, instead of -1, so that it can be casted to (void *). */

View File

@ -22,9 +22,7 @@
#include <time.h>
#include <sys/time.h>
#if USE_VSYSCALL
# include <sysdep-vdso.h>
#include <sysdep-vdso.h>
extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
attribute_hidden;
@ -32,6 +30,4 @@ extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
attribute_hidden;
#endif
#endif /* _LIBC_VDSO_H */

View File

@ -18,9 +18,6 @@
#ifndef _LINUX_X86_64_SYSDEP_H
#define _LINUX_X86_64_SYSDEP_H 1
/* Always enable vsyscalls on x86_64 */
#define ALWAYS_USE_VSYSCALL 1
/* There is some commonality. */
#include <sysdeps/unix/sysv/linux/sysdep.h>
#include <sysdeps/unix/x86_64/sysdep.h>