public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Enable VDSO for static linking on arm
@ 2018-12-02 23:30 Rafael Ávila de Espíndola
  2018-12-03 18:31 ` Joseph Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael Ávila de Espíndola @ 2018-12-02 23:30 UTC (permalink / raw)
  To: libc-alpha; +Cc: Rafael Ávila de Espíndola, Szabolcs.Nagy

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

	[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
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
-# include <dl-vdso.h>
-# include <libc-vdso.h>
+#include <dl-vdso.h>
+#include <libc-vdso.h>
+#include <sysdep-vdso.h>
 
 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 <csu/init-first.c>
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 <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/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 <sysdeps/unix/sysv/linux/sysdep.h>
 #include <sysdeps/unix/arm/sysdep.h>
-- 
2.19.2


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

* Re: [PATCH] Enable VDSO for static linking on arm
  2018-12-02 23:30 [PATCH] Enable VDSO for static linking on arm Rafael Ávila de Espíndola
@ 2018-12-03 18:31 ` Joseph Myers
  2018-12-03 18:52   ` Rafael Avila de Espindola
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Myers @ 2018-12-03 18:31 UTC (permalink / raw)
  To: Rafael Ávila de Espíndola; +Cc: libc-alpha, Szabolcs.Nagy

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Sun, 2 Dec 2018, Rafael Ávila de Espíndola wrote:

> 2018-12-02  Rafael Ávila de Espíndola  <rafael@espindo.la>
> 
> 	[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.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] Enable VDSO for static linking on arm
  2018-12-03 18:31 ` Joseph Myers
@ 2018-12-03 18:52   ` Rafael Avila de Espindola
  2018-12-03 21:01     ` Joseph Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael Avila de Espindola @ 2018-12-03 18:52 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha, Szabolcs.Nagy

"Joseph Myers" <joseph@codesourcery.com> writes:

> On Sun, 2 Dec 2018, Rafael Ávila de Espíndola wrote:
>
>> 2018-12-02  Rafael Ávila de Espíndola  <rafael@espindo.la>
>>
>> 	[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.
>
> OK.

Could you please commit it?

Thanks,
Rafael

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

* Re: [PATCH] Enable VDSO for static linking on arm
  2018-12-03 18:52   ` Rafael Avila de Espindola
@ 2018-12-03 21:01     ` Joseph Myers
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Myers @ 2018-12-03 21:01 UTC (permalink / raw)
  To: Rafael Avila de Espindola; +Cc: libc-alpha, Szabolcs.Nagy

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

On Mon, 3 Dec 2018, Rafael Avila de Espindola wrote:

> "Joseph Myers" <joseph@codesourcery.com> writes:
> 
> > On Sun, 2 Dec 2018, Rafael Ávila de Espíndola wrote:
> >
> >> 2018-12-02  Rafael Ávila de Espíndola  <rafael@espindo.la>
> >>
> >> 	[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.
> >
> > OK.
> 
> Could you please commit it?

Done.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-02 23:30 [PATCH] Enable VDSO for static linking on arm Rafael Ávila de Espíndola
2018-12-03 18:31 ` Joseph Myers
2018-12-03 18:52   ` Rafael Avila de Espindola
2018-12-03 21:01     ` 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).