From patchwork Fri Dec 7 05:48:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= X-Patchwork-Id: 1009179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-98066-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=espindo.la Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="qZd3Has5"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=espindo.la header.i=@espindo.la header.b="jcfElDjE"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43B1kP4XSNz9s1c for ; Fri, 7 Dec 2018 16:49:16 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:from:cc:reply-to:subject:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=E+JjlRttYQ5Nv48byyevnaPmKRyXIH7FAR/lcUNERVNO+SxXUF0un zIvBf2Hz/TLb1OTMFMMQgah6+uxRN3MbY0ezi9/E9ltb14Zie8bVgLX+UPw/tRV4 bHIs8IyrgtaS91O9I0tRUpkeAHGuj6guhbbX932OWDhy60j+0lI13c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:from:cc:reply-to:subject:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=kOuEzzftocS3NnDVN3uy+Xqv45U=; b=qZd3Has57V6Bg9aDP5NRg/wJZTNv RUGalBL8nLtajKdThOp6axYJLsFQx+EA+6zagXh8oP/HuQ1VxFDOcxj83zXhu9c1 u8G1Y6BR1rQslx7DTbejBdlaTq0LQXmw8TxkfyxZkatsSirr4SHZuruHWbYNm+3Y RCyHpFjO5m6kT1M= Received: (qmail 100930 invoked by alias); 7 Dec 2018 05:49:10 -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 100912 invoked by uid 89); 7 Dec 2018 05:49:10 -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, Always X-HELO: mail-40132.protonmail.ch Date: Fri, 07 Dec 2018 05:48:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=espindo.la; s=protonmail; t=1544161741; bh=jVRgoZ8Rd28JlViQzdCsUaTbiH8x0s/dazQc4lb058g=; h=Date:To:From:Cc:Reply-To:Subject:Feedback-ID:From; b=jcfElDjEZb4v7QBklME3A2SEhxcXeF0yClO/Mi0eTL/mveN9E+peS7U/3FGGi7ol5 ByHT9zv3T8tCzfsnpUNf4i6bs8bl7S1PQjAzvAtpSmMClbJM3FIaqkzbzKszSD+49P HB8Ul0MHsOHzMxQk+jIWgCHDBzdBz/GHVZ3MnJko= To: libc-alpha@sourceware.org From: =?utf-8?q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= Cc: mips32r2@gmail.com, michael.kostylev@gmail.com, Rafael Avila de Espindola Reply-To: =?utf-8?q?Rafael_=C3=81vila_de_Esp=C3=ADndola?= Subject: [PATCH] Enable VDSO for static linking on mips Message-ID: MIME-Version: 1.0 From: Rafael Avila de Espindola 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 [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 . */ -#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 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 +#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 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 #include 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 #include 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 #include