From 373f9cff2872cf76b9aee6b4fe7719e04dda122f Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 18 Jan 2019 08:56:51 -0800
Subject: [PATCH 4/5] Disable lazy binding on tests for minimal signal handler
Since MINSIGSTKSZ may not have sufficent stack space to allow lazy
binding, build tests for minimal signal handler with -Wl,-z,now to
disable lazy binding.
* signal/Makefile (LDFLAGS-tst-minsigstksz-1): New. Set to
-Wl,-z,now.
(LDFLAGS-tst-minsigstksz-2): Likewise.
(LDFLAGS-tst-minsigstksz-3): Likewise.
(LDFLAGS-tst-minsigstksz-3a): Likewise.
(LDFLAGS-tst-minsigstksz-4): Likewise.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
UPDATE:
Backported to glibc 2.28
Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@intel.com>
---
ChangeLog | 9 +++++++++
signal/Makefile | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 9e33b6cb..ccd5ff21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-01-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * signal/Makefile (LDFLAGS-tst-minsigstksz-1): New. Set to
+ -Wl,-z,now.
+ (LDFLAGS-tst-minsigstksz-2): Likewise.
+ (LDFLAGS-tst-minsigstksz-3): Likewise.
+ (LDFLAGS-tst-minsigstksz-3a): Likewise.
+ (LDFLAGS-tst-minsigstksz-4): Likewise.
+
2019-01-16 Zack Weinberg <zackw@panix.com>
* support/xsignal.h (xalloc_sigstack, xfree_sigstack)
diff --git a/signal/Makefile b/signal/Makefile
index d5a10d59..7767bb28 100644
--- a/signal/Makefile
+++ b/signal/Makefile
@@ -59,3 +59,11 @@ CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sigwaitinfo.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sigreturn.c += $(no-stack-protector)
+
+# We don't want to test the lazy resolution stack usage, just the
+# execution of the handler and the functions.
+LDFLAGS-tst-minsigstksz-1 = -Wl,-z,now
+LDFLAGS-tst-minsigstksz-2 = -Wl,-z,now
+LDFLAGS-tst-minsigstksz-3 = -Wl,-z,now
+LDFLAGS-tst-minsigstksz-3a = -Wl,-z,now
+LDFLAGS-tst-minsigstksz-4 = -Wl,-z,now
--
2.27.0