From patchwork Sun Dec 2 23:30:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rafael Avila de Espindola X-Patchwork-Id: 30522 Received: (qmail 21058 invoked by alias); 2 Dec 2018 23:30:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21049 invoked by uid 89); 2 Dec 2018 23:30:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=csu X-HELO: mail-40132.protonmail.ch Date: Sun, 02 Dec 2018 23:30:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=espindo.la; s=protonmail; t=1543793445; bh=y9psUpXNE5Kl8UAzSIRhB+nhKy/w3G+RLvQ23ItyeEs=; h=Date:To:From:Cc:Reply-To:Subject:Feedback-ID:From; b=FRFlsqh3W5zI/bw8noJ5gRC2Gea2jmqcSuIxDUCdln7lLE9jzV7YCrxtFsU30nvOb nXIvxj2mZZ1p+yMwXMBYFYbkzxqpA5z2/ulNOK5PyT004461SvB45Z1n2xqG3K4+vx uliE47iHEe6XFGuNIif3uQ/KBhWH1L5lnGFdregQ= To: libc-alpha@sourceware.org From: =?UTF-8?Q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= Cc: =?UTF-8?Q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= , Szabolcs.Nagy@arm.com Reply-To: =?UTF-8?Q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= Subject: [PATCH] Enable VDSO for static linking on arm Message-ID: MIME-Version: 1.0 2018-12-02 Rafael Ávila de Espíndola [BZ #19767] * sysdeps/unix/sysv/linux/arm/init-first.c: Remove #ifdef SHARED. * sysdeps/unix/sysv/linux/arm/libc-vdso.h: Remove #ifdef SHARED. * sysdeps/unix/sysv/linux/arm/sysdep.h: Define ALWAYS_USE_VSYSCALL. --- I have tested that this builds and the resulting program still work. The kernel in gcc117 (which I ussed for testing) seems to be missing https://patchwork.kernel.org/patch/10060431/, so the vdso is never used. diff --git a/sysdeps/unix/sysv/linux/arm/init-first.c b/sysdeps/unix/sysv/linux/arm/init-first.c index f4293b1cf8..7fbdc27227 100644 --- a/sysdeps/unix/sysv/linux/arm/init-first.c +++ b/sysdeps/unix/sysv/linux/arm/init-first.c @@ -17,9 +17,9 @@ License along with the GNU C Library; if not, see . */ -#ifdef SHARED -# include -# include +#include +#include +#include int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden; int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *); @@ -38,7 +38,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/arm/libc-vdso.h b/sysdeps/unix/sysv/linux/arm/libc-vdso.h index 52dd355818..2a8979d356 100644 --- a/sysdeps/unix/sysv/linux/arm/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/arm/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/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index 174c530412..3902d46d55 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -20,6 +20,9 @@ #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 #include