public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4] Enable VDSO on x86_64 statically linked programs.
@ 2018-10-10  4:51 Rafael Avila de Espindola
  2018-11-12  2:01 ` Rafael Avila de Espindola
  2018-11-12 13:01 ` Florian Weimer
  0 siblings, 2 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-10-10  4:51 UTC (permalink / raw)
  To: libc-alpha, H.J. Lu, Florian Weimer, Szabolcs Nagy

All the required code already existed, and some of it was already
running.

AT_SYSINFO_EHDR is processed if NEED_DL_SYSINFO_DSO is defined, but it
looks like it always is. The call to setup_vdso is also unconditional,
so all that was left to do was setup the function pointers and use
them. This patch just deletes some #ifdef to enable that.
---

The only difference from the previous patch is rebasing on top of the
refactoring patch I just emailed.

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

        [BZ #19767]
        * Makeconfig: Add -DUSE_VSYSCALL to CPPFLAGS-.os.
        * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
        * nptl/tst-cond11-static.c: New File.
        * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
          tests-static and tests
        * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
          of SHARED.
        * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
        * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
        instead of SHARED.
        * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
        * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define USE_VSYSCALL.


diff --git a/Makeconfig b/Makeconfig
index fbcf69e7c2..61712dc35e 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -999,7 +999,7 @@ ifeq (yes,$(build-shared))
 # Under --enable-shared, we will build a shared library of PIC objects.
 # The PIC object files are named foo.os.
 object-suffixes += .os
-CPPFLAGS-.os = -DPIC -DSHARED
+CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
 CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
 libtype.os := lib%_pic.a
 # This can be changed by a sysdep makefile
diff --git a/nptl/Makefile b/nptl/Makefile
index be8066524c..1b384548a1 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -449,9 +449,10 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
 tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
 		tst-cancel21-static tst-cancel24-static tst-cond8-static \
 		tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
-		tst-sem12-static
+		tst-sem12-static tst-cond11-static
+
 tests += tst-cancel21-static tst-cancel24-static \
-	 tst-cond8-static
+	 tst-cond8-static tst-cond11-static
 tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
 xtests-static += tst-setuid1-static
 
diff --git a/nptl/tst-cond11-static.c b/nptl/tst-cond11-static.c
new file mode 100644
index 0000000000..9bccb8ec8b
--- /dev/null
+++ b/nptl/tst-cond11-static.c
@@ -0,0 +1 @@
+#include "tst-cond11.c"
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index d047b61af7..9a006d9917 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -145,6 +145,9 @@ sysdep_routines += sched_getcpu oldglob
 
 tests += tst-affinity tst-affinity-pid
 
+tests-static := tst-affinity-static
+tests += $(tests-static)
+
 CFLAGS-fork.c = $(libio-mtsafe)
 CFLAGS-getpid.o = -fomit-frame-pointer
 CFLAGS-getpid.os = -fomit-frame-pointer
diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 7f894c5e02..a50844a710 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -26,7 +26,7 @@
      funcptr (args)
 #endif
 
-#if defined SHARED && defined HAVE_VSYSCALL
+#if defined HAVE_VSYSCALL && defined USE_VSYSCALL
 
 # include <libc-vdso.h>
 
@@ -84,6 +84,6 @@
 # define INTERNAL_VSYSCALL(name, err, nr, args...) \
    INTERNAL_SYSCALL (name, err, nr, ##args)
 
-#endif /* defined SHARED && defined HAVE_VSYSCALL */
+#endif /* defined HAVE_VSYSCALL && defined USE_VSYSCALL  */
 
 #endif /* SYSDEP_VDSO_LINUX_H  */
diff --git a/sysdeps/unix/sysv/linux/tst-affinity-static.c b/sysdeps/unix/sysv/linux/tst-affinity-static.c
new file mode 100644
index 0000000000..4022ea317a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-affinity-static.c
@@ -0,0 +1 @@
+#include "tst-affinity.c"
diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
index 6f86073dae..3ea43263fd 100644
--- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
@@ -22,7 +22,7 @@
 #include <time.h>
 #include <sys/time.h>
 
-#ifdef SHARED
+#ifdef USE_VSYSCALL
 
 # include <sysdep-vdso.h>
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 2320505804..ad19f4b055 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -16,11 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
-# include <time.h>
-# include <sysdep.h>
-# include <dl-vdso.h>
-# include <libc-vdso.h>
+#include <time.h>
+#include <sysdep.h>
+#include <dl-vdso.h>
+#include <libc-vdso.h>
 
 long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
   attribute_hidden;
@@ -46,7 +45,6 @@ __vdso_platform_setup (void)
   VDSO_SYMBOL(getcpu) = p;
 }
 
-# define VDSO_SETUP __vdso_platform_setup
-#endif
+#define VDSO_SETUP __vdso_platform_setup
 
 #include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index f07eb04962..7b98ed5686 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -18,6 +18,11 @@
 #ifndef _LINUX_X86_64_SYSDEP_H
 #define _LINUX_X86_64_SYSDEP_H 1
 
+/* Always enable vsyscalls on x86_64 */
+#ifndef USE_VSYSCALL
+#define USE_VSYSCALL
+#endif
+
 /* There is some commonality.  */
 #include <sysdeps/unix/sysv/linux/sysdep.h>
 #include <sysdeps/unix/x86_64/sysdep.h>
-- 
2.17.1


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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-10-10  4:51 [PATCH v4] Enable VDSO on x86_64 statically linked programs Rafael Avila de Espindola
@ 2018-11-12  2:01 ` Rafael Avila de Espindola
  2018-11-12 13:01 ` Florian Weimer
  1 sibling, 0 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-12  2:01 UTC (permalink / raw)
  To: libc-alpha, H.J. Lu, Florian Weimer, Szabolcs Nagy

ping now that the dependencies have been committed.

Cheers,
Rafael




‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, October 9, 2018 9:49 PM, Rafael Avila de Espindola <rafael@espindo.la> wrote:

> All the required code already existed, and some of it was already
> running.
>
> AT_SYSINFO_EHDR is processed if NEED_DL_SYSINFO_DSO is defined, but it
> looks like it always is. The call to setup_vdso is also unconditional,
> so all that was left to do was setup the function pointers and use
> them. This patch just deletes some #ifdef to enable that.
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> The only difference from the previous patch is rebasing on top of the
> refactoring patch I just emailed.
>
> 2018-10-09 Rafael Ávila de Espíndola rafael@espindo.la
>
> [BZ #19767]
> * Makeconfig: Add -DUSE_VSYSCALL to CPPFLAGS-.os.
> * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
> * nptl/tst-cond11-static.c: New File.
> * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
> tests-static and tests
> * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
> of SHARED.
> * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
> * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
> instead of SHARED.
> * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
> * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define USE_VSYSCALL.
>
> diff --git a/Makeconfig b/Makeconfig
> index fbcf69e7c2..61712dc35e 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -999,7 +999,7 @@ ifeq (yes,$(build-shared))
>
> Under --enable-shared, we will build a shared library of PIC objects.
>
> ======================================================================
>
> The PIC object files are named foo.os.
>
> =======================================
>
> object-suffixes += .os
> -CPPFLAGS-.os = -DPIC -DSHARED
> +CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
> CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
> libtype.os := lib%_pic.a
>
> This can be changed by a sysdep makefile
>
> =========================================
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index be8066524c..1b384548a1 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -449,9 +449,10 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
> tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
> tst-cancel21-static tst-cancel24-static tst-cond8-static \
> tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
>
> -         tst-sem12-static
>
>
>
> -         tst-sem12-static tst-cond11-static
>
>
> -
>
> tests += tst-cancel21-static tst-cancel24-static \
>
> -   tst-cond8-static
>
> -   tst-cond8-static tst-cond11-static
>     tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
>     xtests-static += tst-setuid1-static
>
>     diff --git a/nptl/tst-cond11-static.c b/nptl/tst-cond11-static.c
>     new file mode 100644
>     index 0000000000..9bccb8ec8b
>     --- /dev/null
>     +++ b/nptl/tst-cond11-static.c
>     @@ -0,0 +1 @@
>     +#include "tst-cond11.c"
>     diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
>     index d047b61af7..9a006d9917 100644
>     --- a/sysdeps/unix/sysv/linux/Makefile
>     +++ b/sysdeps/unix/sysv/linux/Makefile
>     @@ -145,6 +145,9 @@ sysdep_routines += sched_getcpu oldglob
>
>     tests += tst-affinity tst-affinity-pid
>
>     +tests-static := tst-affinity-static
>     +tests += $(tests-static)
>
> -
>
> CFLAGS-fork.c = $(libio-mtsafe)
> CFLAGS-getpid.o = -fomit-frame-pointer
> CFLAGS-getpid.os = -fomit-frame-pointer
> diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> index 7f894c5e02..a50844a710 100644
> --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
> +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> @@ -26,7 +26,7 @@
> funcptr (args)
> #endif
>
> -#if defined SHARED && defined HAVE_VSYSCALL
> +#if defined HAVE_VSYSCALL && defined USE_VSYSCALL
>
> include <libc-vdso.h>
>
> ======================
>
> @@ -84,6 +84,6 @@
>
> define INTERNAL_VSYSCALL(name, err, nr, args...) \
>
> ===================================================
>
>     INTERNAL_SYSCALL (name, err, nr, ##args)
>
>
> -#endif /* defined SHARED && defined HAVE_VSYSCALL/
> +#endif / defined HAVE_VSYSCALL && defined USE_VSYSCALL /
> #endif / SYSDEP_VDSO_LINUX_H */diff --git a/sysdeps/unix/sysv/linux/tst-affinity-static.c b/sysdeps/unix/sysv/linux/tst-affinity-static.c
> new file mode 100644
> index 0000000000..4022ea317a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-affinity-static.c
> @@ -0,0 +1 @@
> +#include "tst-affinity.c"
> diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> index 6f86073dae..3ea43263fd 100644
> --- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> +++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> @@ -22,7 +22,7 @@
> #include <time.h>
> #include <sys/time.h>
>
> -#ifdef SHARED
> +#ifdef USE_VSYSCALL
>
> include <sysdep-vdso.h>
>
> ========================
>
> diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
> index 2320505804..ad19f4b055 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
> +++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
> @@ -16,11 +16,10 @@
> License along with the GNU C Library; if not, see
> http://www.gnu.org/licenses/. */
>
> -#ifdef SHARED
> -# include <time.h>
> -# include <sysdep.h>
> -# include <dl-vdso.h>
> -# include <libc-vdso.h>
> +#include <time.h>
> +#include <sysdep.h>
> +#include <dl-vdso.h>
> +#include <libc-vdso.h>
>
> long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
> attribute_hidden;
> @@ -46,7 +45,6 @@ __vdso_platform_setup (void)
> VDSO_SYMBOL(getcpu) = p;
> }
>
> -# define VDSO_SETUP __vdso_platform_setup
> -#endif
> +#define VDSO_SETUP __vdso_platform_setup
>
> #include <csu/init-first.c>
> diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> index f07eb04962..7b98ed5686 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> @@ -18,6 +18,11 @@
> #ifndef _LINUX_X86_64_SYSDEP_H
> #define _LINUX_X86_64_SYSDEP_H 1
>
> +/* Always enable vsyscalls on x86_64 /
> +#ifndef USE_VSYSCALL
> +#define USE_VSYSCALL
> +#endif
> +
> / There is some commonality. */#include <sysdeps/unix/sysv/linux/sysdep.h>
> #include <sysdeps/unix/x86_64/sysdep.h>
> --
> 2.17.1


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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-10-10  4:51 [PATCH v4] Enable VDSO on x86_64 statically linked programs Rafael Avila de Espindola
  2018-11-12  2:01 ` Rafael Avila de Espindola
@ 2018-11-12 13:01 ` Florian Weimer
  2018-11-12 22:38   ` Rafael Avila de Espindola
  1 sibling, 1 reply; 21+ messages in thread
From: Florian Weimer @ 2018-11-12 13:01 UTC (permalink / raw)
  To: Rafael Avila de Espindola; +Cc: libc-alpha, H.J. Lu, Szabolcs Nagy

* Rafael Avila de Espindola:

> diff --git a/Makeconfig b/Makeconfig
> index fbcf69e7c2..61712dc35e 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -999,7 +999,7 @@ ifeq (yes,$(build-shared))
>  # Under --enable-shared, we will build a shared library of PIC objects.
>  # The PIC object files are named foo.os.
>  object-suffixes += .os
> -CPPFLAGS-.os = -DPIC -DSHARED
> +CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
>  CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
>  libtype.os := lib%_pic.a
>  # This can be changed by a sysdep makefile

This doesn't seem to be the right place to define the macro.  We also
prefer macros that are always defined and which change there value
between 0 and 1.

USE_VSYSCALL seems to be a Linux thing and thus should go into
sysdeps/unix/sysv/linux.

It may be clearer to define

#define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)

and then default ALWAYS_USE_VSYSCALL to 0 and override that to 1 for
x86_64.

Thanks,
Florian

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-12 13:01 ` Florian Weimer
@ 2018-11-12 22:38   ` Rafael Avila de Espindola
  2018-11-20 14:58     ` Rafael Avila de Espindola
  2018-11-20 17:03     ` H.J. Lu
  0 siblings, 2 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-12 22:38 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha, H.J. Lu, Szabolcs Nagy

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

> > object-suffixes += .os
> > -CPPFLAGS-.os = -DPIC -DSHARED
> > +CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
> > CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
> > libtype.os := lib%_pic.a
> >
> > This can be changed by a sysdep makefile
> >
> > =========================================
>
> This doesn't seem to be the right place to define the macro. We also
> prefer macros that are always defined and which change there value
> between 0 and 1.
>
> USE_VSYSCALL seems to be a Linux thing and thus should go into
> sysdeps/unix/sysv/linux.
>
> It may be clearer to define
>
> #define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)
>
> and then default ALWAYS_USE_VSYSCALL to 0 and override that to 1 for
> x86_64.


Thanks. A new version is attached and it uses your suggestion.

The new ChangeLog is

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

        [BZ #19767]
        * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
        * nptl/tst-cond11-static.c: New File.
        * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
          tests-static and tests
        * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
          of SHARED.
	* sysdeps/unix/sysv/linux/sysdep.h: Define ALWAYS_USE_VSYSCALL and
	  USE_VSYSCALL.
        * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
        * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
          instead of SHARED.
        * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
        * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define ALWAYS_USE_VSYSCALL.


Cheers,
Rafael


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Enable-VDSO-on-x86_64-statically-linked-programs.patch --]
[-- Type: text/x-patch; name="0001-Enable-VDSO-on-x86_64-statically-linked-programs.patch", Size: 5925 bytes --]

From e035a9e1da87daec5e0b8f735734df42e595646b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?=
 <rafael@espindo.la>
Date: Thu, 8 Nov 2018 23:25:31 -0800
Subject: [PATCH] Enable VDSO on x86_64 statically linked programs.

All the required code already existed, and some of it was already
running.

AT_SYSINFO_EHDR is processed if NEED_DL_SYSINFO_DSO is defined, but it
looks like it always is. The call to setup_vdso is also unconditional,
so all that was left to do was setup the function pointers and use
them. This patch just deletes some #ifdef to enable that.
---
 nptl/Makefile                                 |  5 +++--
 nptl/tst-cond11-static.c                      |  1 +
 sysdeps/unix/sysv/linux/Makefile              |  3 +++
 sysdeps/unix/sysv/linux/sysdep-vdso.h         |  4 ++--
 sysdeps/unix/sysv/linux/sysdep.h              |  7 +++++++
 sysdeps/unix/sysv/linux/tst-affinity-static.c |  1 +
 sysdeps/unix/sysv/linux/x86/libc-vdso.h       |  2 +-
 sysdeps/unix/sysv/linux/x86_64/init-first.c   | 12 +++++-------
 sysdeps/unix/sysv/linux/x86_64/sysdep.h       |  3 +++
 9 files changed, 26 insertions(+), 12 deletions(-)
 create mode 100644 nptl/tst-cond11-static.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-affinity-static.c

diff --git a/nptl/Makefile b/nptl/Makefile
index 49b6faa330..982e43adfa 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -449,9 +449,10 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
 tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
 		tst-cancel21-static tst-cancel24-static tst-cond8-static \
 		tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
-		tst-sem12-static
+		tst-sem12-static tst-cond11-static
+
 tests += tst-cancel21-static tst-cancel24-static \
-	 tst-cond8-static
+	 tst-cond8-static tst-cond11-static
 tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
 xtests-static += tst-setuid1-static
 
diff --git a/nptl/tst-cond11-static.c b/nptl/tst-cond11-static.c
new file mode 100644
index 0000000000..9bccb8ec8b
--- /dev/null
+++ b/nptl/tst-cond11-static.c
@@ -0,0 +1 @@
+#include "tst-cond11.c"
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 72b6b641d5..362cf3b950 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -146,6 +146,9 @@ sysdep_routines += sched_getcpu oldglob
 
 tests += tst-affinity tst-affinity-pid
 
+tests-static := tst-affinity-static
+tests += $(tests-static)
+
 CFLAGS-fork.c = $(libio-mtsafe)
 CFLAGS-getpid.o = -fomit-frame-pointer
 CFLAGS-getpid.os = -fomit-frame-pointer
diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 7f894c5e02..1ee0657ad3 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -26,7 +26,7 @@
      funcptr (args)
 #endif
 
-#if defined SHARED && defined HAVE_VSYSCALL
+#if USE_VSYSCALL && defined HAVE_VSYSCALL
 
 # include <libc-vdso.h>
 
@@ -84,6 +84,6 @@
 # define INTERNAL_VSYSCALL(name, err, nr, args...) \
    INTERNAL_SYSCALL (name, err, nr, ##args)
 
-#endif /* defined SHARED && defined HAVE_VSYSCALL */
+#endif /* USE_VSYSCALL && defined HAVE_VSYSCALL */
 
 #endif /* SYSDEP_VDSO_LINUX_H  */
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index 4fd0a9bae3..9655436ee4 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -18,6 +18,13 @@
 #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 *).  */
diff --git a/sysdeps/unix/sysv/linux/tst-affinity-static.c b/sysdeps/unix/sysv/linux/tst-affinity-static.c
new file mode 100644
index 0000000000..4022ea317a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-affinity-static.c
@@ -0,0 +1 @@
+#include "tst-affinity.c"
diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
index 6f86073dae..b9b4b93011 100644
--- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
@@ -22,7 +22,7 @@
 #include <time.h>
 #include <sys/time.h>
 
-#ifdef SHARED
+#if USE_VSYSCALL
 
 # include <sysdep-vdso.h>
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 2320505804..ad19f4b055 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -16,11 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
-# include <time.h>
-# include <sysdep.h>
-# include <dl-vdso.h>
-# include <libc-vdso.h>
+#include <time.h>
+#include <sysdep.h>
+#include <dl-vdso.h>
+#include <libc-vdso.h>
 
 long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
   attribute_hidden;
@@ -46,7 +45,6 @@ __vdso_platform_setup (void)
   VDSO_SYMBOL(getcpu) = p;
 }
 
-# define VDSO_SETUP __vdso_platform_setup
-#endif
+#define VDSO_SETUP __vdso_platform_setup
 
 #include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index f07eb04962..9f49347ce5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -18,6 +18,9 @@
 #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>
-- 
2.19.1


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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-12 22:38   ` Rafael Avila de Espindola
@ 2018-11-20 14:58     ` Rafael Avila de Espindola
  2018-11-20 17:03     ` H.J. Lu
  1 sibling, 0 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-20 14:58 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha, H.J. Lu, Szabolcs Nagy

Ping

>
> Thanks. A new version is attached and it uses your suggestion.
>
> The new ChangeLog is
>
> 2018-11-12  Rafael Ávila de Espíndola  <rafael@espindo.la>
>
>         [BZ #19767]
>         * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
>         * nptl/tst-cond11-static.c: New File.
>         * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
>           tests-static and tests
>         * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
>           of SHARED.
> 	* sysdeps/unix/sysv/linux/sysdep.h: Define ALWAYS_USE_VSYSCALL and
> 	  USE_VSYSCALL.
>         * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
>         * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
>           instead of SHARED.
>         * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
>         * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define ALWAYS_USE_VSYSCALL.
>
>
> Cheers,
> Rafael
> From e035a9e1da87daec5e0b8f735734df42e595646b Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?=
>  <rafael@espindo.la>
> Date: Thu, 8 Nov 2018 23:25:31 -0800
> Subject: [PATCH] Enable VDSO on x86_64 statically linked programs.
>
> All the required code already existed, and some of it was already
> running.
>
> AT_SYSINFO_EHDR is processed if NEED_DL_SYSINFO_DSO is defined, but it
> looks like it always is. The call to setup_vdso is also unconditional,
> so all that was left to do was setup the function pointers and use
> them. This patch just deletes some #ifdef to enable that.
> ---
>  nptl/Makefile                                 |  5 +++--
>  nptl/tst-cond11-static.c                      |  1 +
>  sysdeps/unix/sysv/linux/Makefile              |  3 +++
>  sysdeps/unix/sysv/linux/sysdep-vdso.h         |  4 ++--
>  sysdeps/unix/sysv/linux/sysdep.h              |  7 +++++++
>  sysdeps/unix/sysv/linux/tst-affinity-static.c |  1 +
>  sysdeps/unix/sysv/linux/x86/libc-vdso.h       |  2 +-
>  sysdeps/unix/sysv/linux/x86_64/init-first.c   | 12 +++++-------
>  sysdeps/unix/sysv/linux/x86_64/sysdep.h       |  3 +++
>  9 files changed, 26 insertions(+), 12 deletions(-)
>  create mode 100644 nptl/tst-cond11-static.c
>  create mode 100644 sysdeps/unix/sysv/linux/tst-affinity-static.c
>
> diff --git a/nptl/Makefile b/nptl/Makefile
> index 49b6faa330..982e43adfa 100644
> --- a/nptl/Makefile
> +++ b/nptl/Makefile
> @@ -449,9 +449,10 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
>  tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
>  		tst-cancel21-static tst-cancel24-static tst-cond8-static \
>  		tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
> -		tst-sem12-static
> +		tst-sem12-static tst-cond11-static
> +
>  tests += tst-cancel21-static tst-cancel24-static \
> -	 tst-cond8-static
> +	 tst-cond8-static tst-cond11-static
>  tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
>  xtests-static += tst-setuid1-static
>  
> diff --git a/nptl/tst-cond11-static.c b/nptl/tst-cond11-static.c
> new file mode 100644
> index 0000000000..9bccb8ec8b
> --- /dev/null
> +++ b/nptl/tst-cond11-static.c
> @@ -0,0 +1 @@
> +#include "tst-cond11.c"
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 72b6b641d5..362cf3b950 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -146,6 +146,9 @@ sysdep_routines += sched_getcpu oldglob
>  
>  tests += tst-affinity tst-affinity-pid
>  
> +tests-static := tst-affinity-static
> +tests += $(tests-static)
> +
>  CFLAGS-fork.c = $(libio-mtsafe)
>  CFLAGS-getpid.o = -fomit-frame-pointer
>  CFLAGS-getpid.os = -fomit-frame-pointer
> diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> index 7f894c5e02..1ee0657ad3 100644
> --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
> +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
> @@ -26,7 +26,7 @@
>       funcptr (args)
>  #endif
>  
> -#if defined SHARED && defined HAVE_VSYSCALL
> +#if USE_VSYSCALL && defined HAVE_VSYSCALL
>  
>  # include <libc-vdso.h>
>  
> @@ -84,6 +84,6 @@
>  # define INTERNAL_VSYSCALL(name, err, nr, args...) \
>     INTERNAL_SYSCALL (name, err, nr, ##args)
>  
> -#endif /* defined SHARED && defined HAVE_VSYSCALL */
> +#endif /* USE_VSYSCALL && defined HAVE_VSYSCALL */
>  
>  #endif /* SYSDEP_VDSO_LINUX_H  */
> diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
> index 4fd0a9bae3..9655436ee4 100644
> --- a/sysdeps/unix/sysv/linux/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/sysdep.h
> @@ -18,6 +18,13 @@
>  #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 *).  */
> diff --git a/sysdeps/unix/sysv/linux/tst-affinity-static.c b/sysdeps/unix/sysv/linux/tst-affinity-static.c
> new file mode 100644
> index 0000000000..4022ea317a
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-affinity-static.c
> @@ -0,0 +1 @@
> +#include "tst-affinity.c"
> diff --git a/sysdeps/unix/sysv/linux/x86/libc-vdso.h b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> index 6f86073dae..b9b4b93011 100644
> --- a/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> +++ b/sysdeps/unix/sysv/linux/x86/libc-vdso.h
> @@ -22,7 +22,7 @@
>  #include <time.h>
>  #include <sys/time.h>
>  
> -#ifdef SHARED
> +#if USE_VSYSCALL
>  
>  # include <sysdep-vdso.h>
>  
> diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
> index 2320505804..ad19f4b055 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
> +++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
> @@ -16,11 +16,10 @@
>     License along with the GNU C Library; if not, see
>     <http://www.gnu.org/licenses/>.  */
>  
> -#ifdef SHARED
> -# include <time.h>
> -# include <sysdep.h>
> -# include <dl-vdso.h>
> -# include <libc-vdso.h>
> +#include <time.h>
> +#include <sysdep.h>
> +#include <dl-vdso.h>
> +#include <libc-vdso.h>
>  
>  long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
>    attribute_hidden;
> @@ -46,7 +45,6 @@ __vdso_platform_setup (void)
>    VDSO_SYMBOL(getcpu) = p;
>  }
>  
> -# define VDSO_SETUP __vdso_platform_setup
> -#endif
> +#define VDSO_SETUP __vdso_platform_setup
>  
>  #include <csu/init-first.c>
> diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> index f07eb04962..9f49347ce5 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
> @@ -18,6 +18,9 @@
>  #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>
> -- 
> 2.19.1

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-12 22:38   ` Rafael Avila de Espindola
  2018-11-20 14:58     ` Rafael Avila de Espindola
@ 2018-11-20 17:03     ` H.J. Lu
  2018-11-20 17:25       ` Rafael Avila de Espindola
  1 sibling, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-11-20 17:03 UTC (permalink / raw)
  To: Rafael Avila de Espindola; +Cc: Florian Weimer, GNU C Library, szabolcs.nagy

On Mon, Nov 12, 2018 at 2:38 PM Rafael Avila de Espindola
<rafael@espindo.la> wrote:
>
> > > object-suffixes += .os
> > > -CPPFLAGS-.os = -DPIC -DSHARED
> > > +CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
> > > CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
> > > libtype.os := lib%_pic.a
> > >
> > > This can be changed by a sysdep makefile
> > >
> > > =========================================
> >
> > This doesn't seem to be the right place to define the macro. We also
> > prefer macros that are always defined and which change there value
> > between 0 and 1.
> >
> > USE_VSYSCALL seems to be a Linux thing and thus should go into
> > sysdeps/unix/sysv/linux.
> >
> > It may be clearer to define
> >
> > #define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)
> >
> > and then default ALWAYS_USE_VSYSCALL to 0 and override that to 1 for
> > x86_64.
>
>
> Thanks. A new version is attached and it uses your suggestion.
>
> The new ChangeLog is
>
> 2018-11-12  Rafael Ávila de Espíndola  <rafael@espindo.la>
>
>         [BZ #19767]
>         * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
>         * nptl/tst-cond11-static.c: New File.
>         * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
>           tests-static and tests
>         * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
>           of SHARED.
>         * sysdeps/unix/sysv/linux/sysdep.h: Define ALWAYS_USE_VSYSCALL and
>           USE_VSYSCALL.
>         * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
>         * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
>           instead of SHARED.
>         * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
>         * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define ALWAYS_USE_VSYSCALL.
>
>

LGTM.

Thanks.

-- 
H.J.

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-20 17:03     ` H.J. Lu
@ 2018-11-20 17:25       ` Rafael Avila de Espindola
  2018-11-23 16:56         ` Rafael Avila de Espindola
  0 siblings, 1 reply; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-20 17:25 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, GNU C Library, szabolcs.nagy

"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Mon, Nov 12, 2018 at 2:38 PM Rafael Avila de Espindola
> <rafael@espindo.la> wrote:
>>
>> > > object-suffixes += .os
>> > > -CPPFLAGS-.os = -DPIC -DSHARED
>> > > +CPPFLAGS-.os = -DPIC -DSHARED -DUSE_VSYSCALL
>> > > CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag)
>> > > libtype.os := lib%_pic.a
>> > >
>> > > This can be changed by a sysdep makefile
>> > >
>> > > =========================================
>> >
>> > This doesn't seem to be the right place to define the macro. We also
>> > prefer macros that are always defined and which change there value
>> > between 0 and 1.
>> >
>> > USE_VSYSCALL seems to be a Linux thing and thus should go into
>> > sysdeps/unix/sysv/linux.
>> >
>> > It may be clearer to define
>> >
>> > #define USE_VSYSCALL (defined (SHARED) || ALWAYS_USE_VSYSCALL)
>> >
>> > and then default ALWAYS_USE_VSYSCALL to 0 and override that to 1 for
>> > x86_64.
>>
>>
>> Thanks. A new version is attached and it uses your suggestion.
>>
>> The new ChangeLog is
>>
>> 2018-11-12  Rafael Ávila de Espíndola  <rafael@espindo.la>
>>
>>         [BZ #19767]
>>         * nptl/Makefile: Add tst-cond11-static to tests-static and tests.
>>         * nptl/tst-cond11-static.c: New File.
>>         * sysdeps/unix/sysv/linux/Makefile: Add tst-affinity-static to
>>           tests-static and tests
>>         * sysdeps/unix/sysv/linux/sysdep-vdso.h: Use USE_VSYSCALL instead
>>           of SHARED.
>>         * sysdeps/unix/sysv/linux/sysdep.h: Define ALWAYS_USE_VSYSCALL and
>>           USE_VSYSCALL.
>>         * sysdeps/unix/sysv/linux/tst-affinity-static.c: New file.
>>         * sysdeps/unix/sysv/linux/x86/libc-vdso.h: Use USE_VSYSCALL
>>           instead of SHARED.
>>         * sysdeps/unix/sysv/linux/x86_64/init-first.c: remove #ifdef SHARED.
>>         * sysdeps/unix/sysv/linux/x86_64/sysdep.h: define ALWAYS_USE_VSYSCALL.
>>
>>
>
> LGTM.

If you could commit it that would be awesome.

Thanks,
Rafael

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-20 17:25       ` Rafael Avila de Espindola
@ 2018-11-23 16:56         ` Rafael Avila de Espindola
  2018-11-24  0:52           ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-23 16:56 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, GNU C Library, szabolcs.nagy

"Rafael Avila de Espindola" <rafael@espindo.la> writes:

>> LGTM.
>
> If you could commit it that would be awesome.

Ping.

Cheers,
Rafael

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-23 16:56         ` Rafael Avila de Espindola
@ 2018-11-24  0:52           ` H.J. Lu
  2018-11-24  1:21             ` Rafael Avila de Espindola
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-11-24  0:52 UTC (permalink / raw)
  To: Rafael Avila de Espindola; +Cc: Florian Weimer, GNU C Library, szabolcs.nagy

On Fri, Nov 23, 2018 at 8:56 AM Rafael Avila de Espindola
<rafael@espindo.la> wrote:
>
> "Rafael Avila de Espindola" <rafael@espindo.la> writes:
>
> >> LGTM.
> >
> > If you could commit it that would be awesome.
>
> Ping.
>

Done.

-- 
H.J.

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-24  0:52           ` H.J. Lu
@ 2018-11-24  1:21             ` Rafael Avila de Espindola
  2018-11-26  9:32               ` Andreas Schwab
  0 siblings, 1 reply; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-24  1:21 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, GNU C Library, szabolcs.nagy

"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Fri, Nov 23, 2018 at 8:56 AM Rafael Avila de Espindola
> <rafael@espindo.la> wrote:
>>
>> "Rafael Avila de Espindola" <rafael@espindo.la> writes:
>>
>> >> LGTM.
>> >
>> > If you could commit it that would be awesome.
>>
>> Ping.
>>
>
> Done.

Thanks!

Cheers,
Rafael

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-24  1:21             ` Rafael Avila de Espindola
@ 2018-11-26  9:32               ` Andreas Schwab
  2018-11-26 13:39                 ` Tulio Magno Quites Machado Filho
  2018-11-26 16:23                 ` Rafael Avila de Espindola
  0 siblings, 2 replies; 21+ messages in thread
From: Andreas Schwab @ 2018-11-26  9:32 UTC (permalink / raw)
  To: Rafael Avila de Espindola
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

In file included from ../sysdeps/unix/sysv/linux/powerpc/libc-vdso.h:25,
                 from ../sysdeps/powerpc/powerpc32/backtrace.c:23:
../sysdeps/unix/sysv/linux/sysdep-vdso.h:29:5: error: "USE_VSYSCALL" is not defined, evaluates to 0 [-Werror=undef]
 #if USE_VSYSCALL && defined HAVE_VSYSCALL
     ^~~~~~~~~~~~

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-26  9:32               ` Andreas Schwab
@ 2018-11-26 13:39                 ` Tulio Magno Quites Machado Filho
  2018-11-26 16:23                 ` Rafael Avila de Espindola
  1 sibling, 0 replies; 21+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-11-26 13:39 UTC (permalink / raw)
  To: Andreas Schwab, Rafael Avila de Espindola
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

Andreas Schwab <schwab@suse.de> writes:

> In file included from ../sysdeps/unix/sysv/linux/powerpc/libc-vdso.h:25,
>                  from ../sysdeps/powerpc/powerpc32/backtrace.c:23:
> ../sysdeps/unix/sysv/linux/sysdep-vdso.h:29:5: error: "USE_VSYSCALL" is not defined, evaluates to 0 [-Werror=undef]
>  #if USE_VSYSCALL && defined HAVE_VSYSCALL
>      ^~~~~~~~~~~~

Fixed with commit 8ae74eadb60e.

-- 
Tulio Magno

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-26  9:32               ` Andreas Schwab
  2018-11-26 13:39                 ` Tulio Magno Quites Machado Filho
@ 2018-11-26 16:23                 ` Rafael Avila de Espindola
  2018-11-27 16:19                   ` Tulio Magno Quites Machado Filho
  1 sibling, 1 reply; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-26 16:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

"Andreas Schwab" <schwab@suse.de> writes:

> In file included from ../sysdeps/unix/sysv/linux/powerpc/libc-vdso.h:25,
>                  from ../sysdeps/powerpc/powerpc32/backtrace.c:23:
> ../sysdeps/unix/sysv/linux/sysdep-vdso.h:29:5: error: "USE_VSYSCALL" is not defined, evaluates to 0 [-Werror=undef]
>  #if USE_VSYSCALL && defined HAVE_VSYSCALL

Sorry about that.

While the particular build problem on powerpc is now fixed, maybe we
should just include sysdep.h from sysdep-vdso.h?

The attached patch does just that. The changelog is

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

	[BZ #19767]
	* sysdeps/unix/sysv/linux/sysdep-vdso.h: include sysdep.h.

Cheers,
Rafael


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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-26 16:23                 ` Rafael Avila de Espindola
@ 2018-11-27 16:19                   ` Tulio Magno Quites Machado Filho
  2018-11-27 18:18                     ` Rafael Avila de Espindola
  0 siblings, 1 reply; 21+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-11-27 16:19 UTC (permalink / raw)
  To: Rafael Avila de Espindola, Andreas Schwab
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

Rafael Avila de Espindola <rafael@espindo.la> writes:

> "Andreas Schwab" <schwab@suse.de> writes:
>
>> In file included from ../sysdeps/unix/sysv/linux/powerpc/libc-vdso.h:25,
>>                  from ../sysdeps/powerpc/powerpc32/backtrace.c:23:
>> ../sysdeps/unix/sysv/linux/sysdep-vdso.h:29:5: error: "USE_VSYSCALL" is not defined, evaluates to 0 [-Werror=undef]
>>  #if USE_VSYSCALL && defined HAVE_VSYSCALL
>
> Sorry about that.
>
> While the particular build problem on powerpc is now fixed, maybe we
> should just include sysdep.h from sysdep-vdso.h?
>
> The attached patch does just that. The changelog is

The patch is missing.

> 2018-11-26  Rafael Ávila de Espíndola  <rafael@espindo.la>
>
> 	[BZ #19767]
> 	* sysdeps/unix/sysv/linux/sysdep-vdso.h: include sysdep.h.

Uppercase sentence  -----------------------------^

-- 
Tulio Magno

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-27 16:19                   ` Tulio Magno Quites Machado Filho
@ 2018-11-27 18:18                     ` Rafael Avila de Espindola
  2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-27 18:18 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho, Andreas Schwab
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

"Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:

> Rafael Avila de Espindola <rafael@espindo.la> writes:
>
>> "Andreas Schwab" <schwab@suse.de> writes:
>>
>>> In file included from ../sysdeps/unix/sysv/linux/powerpc/libc-vdso.h:25,
>>>                  from ../sysdeps/powerpc/powerpc32/backtrace.c:23:
>>> ../sysdeps/unix/sysv/linux/sysdep-vdso.h:29:5: error: "USE_VSYSCALL" is not defined, evaluates to 0 [-Werror=undef]
>>>  #if USE_VSYSCALL && defined HAVE_VSYSCALL
>>
>> Sorry about that.
>>
>> While the particular build problem on powerpc is now fixed, maybe we
>> should just include sysdep.h from sysdep-vdso.h?
>>
>> The attached patch does just that. The changelog is
>
> The patch is missing.

Oops. Attached now.


The fixed changelog is

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

        [BZ #19767]
        * sysdeps/unix/sysv/linux/sysdep-vdso.h: Include sysdep.h.

Cheers,
Rafael

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-27 18:18                     ` Rafael Avila de Espindola
@ 2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
  2018-11-28 12:57                         ` Florian Weimer
                                           ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-11-28 12:55 UTC (permalink / raw)
  To: Rafael Avila de Espindola, Andreas Schwab
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

Rafael Avila de Espindola <rafael@espindo.la> writes:

> "Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:
>
>> Rafael Avila de Espindola <rafael@espindo.la> writes:
>>
>>> The attached patch does just that. The changelog is
>>
>> The patch is missing.
>
> Oops. Attached now.

There is nothing here again.

Maybe the mailing list is removing your patch?

I couldn't find a hint here:
https://sourceware.org/ml/libc-alpha/2018-11/msg00717.html

-- 
Tulio Magno

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
@ 2018-11-28 12:57                         ` Florian Weimer
  2018-11-28 18:01                           ` Rafael Avila de Espindola
  2018-11-28 17:59                         ` Rafael Avila de Espindola
  2018-11-28 22:35                         ` Rafal Luzynski
  2 siblings, 1 reply; 21+ messages in thread
From: Florian Weimer @ 2018-11-28 12:57 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho
  Cc: Rafael Avila de Espindola, Andreas Schwab, H.J. Lu,
	GNU C Library, szabolcs.nagy

* Tulio Magno Quites Machado Filho:

> Rafael Avila de Espindola <rafael@espindo.la> writes:
>
>> "Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:
>>
>>> Rafael Avila de Espindola <rafael@espindo.la> writes:
>>>
>>>> The attached patch does just that. The changelog is
>>>
>>> The patch is missing.
>>
>> Oops. Attached now.
>
> There is nothing here again.
>
> Maybe the mailing list is removing your patch?

Then Red Hat email system removes it as well. 8-/

Note that including <sysdep.h> can be problematic because on certain
architectures, not all assembler files are compatible with <sysdep.h>,
so if <sysdep-vdso.h> ends in assembler files, that could be a problem.

Thanks,
Florian

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
  2018-11-28 12:57                         ` Florian Weimer
@ 2018-11-28 17:59                         ` Rafael Avila de Espindola
  2018-11-28 22:35                         ` Rafal Luzynski
  2 siblings, 0 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-28 17:59 UTC (permalink / raw)
  To: Tulio Magno Quites Machado Filho, Andreas Schwab
  Cc: H.J. Lu, Florian Weimer, GNU C Library, szabolcs.nagy

"Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:

> Rafael Avila de Espindola <rafael@espindo.la> writes:
>
>> "Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:
>>
>>> Rafael Avila de Espindola <rafael@espindo.la> writes:
>>>
>>>> The attached patch does just that. The changelog is
>>>
>>> The patch is missing.
>>
>> Oops. Attached now.
>
> There is nothing here again.
>
> Maybe the mailing list is removing your patch?
>
> I couldn't find a hint here:
> https://sourceware.org/ml/libc-alpha/2018-11/msg00717.html

That is odd.

I have been having DMARC problems with the list, but this is just
peculiar.

Trying to just copy and paste it.

Cheers,
Rafael

We need to include sysdep.h to make sure USE_VSYSCALL is defined.
---
 sysdeps/unix/sysv/linux/sysdep-vdso.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 1ee0657ad3..9ac31d3c06 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -19,6 +19,8 @@
 #ifndef SYSDEP_VDSO_LINUX_H
 # define SYSDEP_VDSO_LINUX_H

+#include <sysdep.h>
+
 #define VDSO_SYMBOL(__name) __vdso_##__name

 #ifndef INTERNAL_VSYSCALL_CALL

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-28 12:57                         ` Florian Weimer
@ 2018-11-28 18:01                           ` Rafael Avila de Espindola
  0 siblings, 0 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-28 18:01 UTC (permalink / raw)
  To: Florian Weimer, Tulio Magno Quites Machado Filho
  Cc: Andreas Schwab, H.J. Lu, GNU C Library, szabolcs.nagy

"Florian Weimer" <fweimer@redhat.com> writes:

> * Tulio Magno Quites Machado Filho:
>
>> Rafael Avila de Espindola <rafael@espindo.la> writes:
>>
>>> "Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:
>>>
>>>> Rafael Avila de Espindola <rafael@espindo.la> writes:
>>>>
>>>>> The attached patch does just that. The changelog is
>>>>
>>>> The patch is missing.
>>>
>>> Oops. Attached now.
>>
>> There is nothing here again.
>>
>> Maybe the mailing list is removing your patch?
>
> Then Red Hat email system removes it as well. 8-/
>
> Note that including <sysdep.h> can be problematic because on certain
> architectures, not all assembler files are compatible with <sysdep.h>,
> so if <sysdep-vdso.h> ends in assembler files, that could be a problem.

Looks like powerpc was the only build failure, so it might not be worth
the risk.

I will keep updating one arch at a time as I find time to test it on the
gcc farm.

Cheers,
Rafael

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
  2018-11-28 12:57                         ` Florian Weimer
  2018-11-28 17:59                         ` Rafael Avila de Espindola
@ 2018-11-28 22:35                         ` Rafal Luzynski
  2018-11-28 23:59                           ` Rafael Avila de Espindola
  2 siblings, 1 reply; 21+ messages in thread
From: Rafal Luzynski @ 2018-11-28 22:35 UTC (permalink / raw)
  To: Rafael Avila de Espindola; +Cc: GNU C Library

28.11.2018 13:55 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br>
wrote:
> 
> Rafael Avila de Espindola <rafael@espindo.la> writes:
> 
> > "Tulio Magno Quites Machado Filho" <tuliom@ascii.art.br> writes:
> >
> >> Rafael Avila de Espindola <rafael@espindo.la> writes:
> >>
> >>> The attached patch does just that. The changelog is
> >>
> >> The patch is missing.
> >
> > Oops. Attached now.
> 
> There is nothing here again.
> 
> Maybe the mailing list is removing your patch?
> [...]

Rafael, does your email body contain a line consisting of only a single
dot?  I saw SMTP servers treating it as the end of message and removing
everything below.

Regards,

Rafal

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

* Re: [PATCH v4] Enable VDSO on x86_64 statically linked programs.
  2018-11-28 22:35                         ` Rafal Luzynski
@ 2018-11-28 23:59                           ` Rafael Avila de Espindola
  0 siblings, 0 replies; 21+ messages in thread
From: Rafael Avila de Espindola @ 2018-11-28 23:59 UTC (permalink / raw)
  To: Rafal Luzynski; +Cc: GNU C Library

"Rafal Luzynski" <digitalfreak@lingonborough.com> writes:

> Rafael, does your email body contain a line consisting of only a single
> dot?  I saw SMTP servers treating it as the end of message and removing
> everything below.

Not that I can see. It looks like just the patch is missing. The content
I have after what is in
https://sourceware.org/ml/libc-alpha/2018-11/msg00717.html is:

------------------------------------------------------------
From be1a08b6257b4043ffab0cae9f4f49f49e47d0b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?=
 <rafael@espindo.la>
Date: Mon, 26 Nov 2018 08:14:39 -0800
Subject: [PATCH] Include missing header.

We need to include sysdep.h to make sure USE_VSYSCALL is defined.
---
 sysdeps/unix/sysv/linux/sysdep-vdso.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h
index 1ee0657ad3..9ac31d3c06 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -19,6 +19,8 @@
 #ifndef SYSDEP_VDSO_LINUX_H
 # define SYSDEP_VDSO_LINUX_H

+#include <sysdep.h>
+
 #define VDSO_SYMBOL(__name) __vdso_##__name

 #ifndef INTERNAL_VSYSCALL_CALL
------------------------------------------------------------

Cheers,
Rafael

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

end of thread, other threads:[~2018-11-28 23:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10  4:51 [PATCH v4] Enable VDSO on x86_64 statically linked programs Rafael Avila de Espindola
2018-11-12  2:01 ` Rafael Avila de Espindola
2018-11-12 13:01 ` Florian Weimer
2018-11-12 22:38   ` Rafael Avila de Espindola
2018-11-20 14:58     ` Rafael Avila de Espindola
2018-11-20 17:03     ` H.J. Lu
2018-11-20 17:25       ` Rafael Avila de Espindola
2018-11-23 16:56         ` Rafael Avila de Espindola
2018-11-24  0:52           ` H.J. Lu
2018-11-24  1:21             ` Rafael Avila de Espindola
2018-11-26  9:32               ` Andreas Schwab
2018-11-26 13:39                 ` Tulio Magno Quites Machado Filho
2018-11-26 16:23                 ` Rafael Avila de Espindola
2018-11-27 16:19                   ` Tulio Magno Quites Machado Filho
2018-11-27 18:18                     ` Rafael Avila de Espindola
2018-11-28 12:55                       ` Tulio Magno Quites Machado Filho
2018-11-28 12:57                         ` Florian Weimer
2018-11-28 18:01                           ` Rafael Avila de Espindola
2018-11-28 17:59                         ` Rafael Avila de Espindola
2018-11-28 22:35                         ` Rafal Luzynski
2018-11-28 23:59                           ` Rafael Avila de Espindola

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).