This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 09/12] Link various tests with -fno-stack-protector.
- From: Nix <nix at esperi dot org dot uk>
- To: libc-alpha at sourceware dot org
- Cc: fweimer at redhat dot com, Nick Alcock <nick dot alcock at oracle dot com>
- Date: Mon, 28 Nov 2016 12:32:25 +0000
- Subject: [PATCH 09/12] Link various tests with -fno-stack-protector.
- Authentication-results: sourceware.org; auth=none
- References: <20161128123228.30856-1-nix@esperi.org.uk>
From: Nick Alcock <nick.alcock@oracle.com>
These tests do not link with libc, so cannot see __stack_chk_fail().
v3: Use $(no-stack-protector).
* elf/Makefile (CFLAGS-filtmod1.c): Use $(no-stack-protector) for
non-libc-linking testcase.
(CFLAGS-filtmod2.c): Likewise.
* stdlib/Makefile (CFLAGS-tst-putenvmod.c): Likewise.
* sysdeps/x86_64/Makefile (CFLAGS-tst-quad1pie.c): Likewise.
(CFLAGS-tst-quad2pie.c): Likewise.
---
elf/Makefile | 4 ++++
stdlib/Makefile | 3 +++
sysdeps/x86_64/Makefile | 3 +++
3 files changed, 10 insertions(+)
diff --git a/elf/Makefile b/elf/Makefile
index daf0ebd..7588ca0 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -775,6 +775,10 @@ $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
$< -Wl,-F,$(objpfx)filtmod2.so
$(objpfx)filter: $(objpfx)filtmod1.so
+# These do not link against libc.
+CFLAGS-filtmod1.c = $(no-stack-protector)
+CFLAGS-filtmod2.c = $(no-stack-protector)
+
$(objpfx)unload: $(libdl)
$(objpfx)unload.out: $(objpfx)unloadmod.so
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 3cce9d9..6d7586e 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -187,6 +187,9 @@ LDFLAGS-tst-putenv = $(no-as-needed)
$(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os $(link-libc-deps)
$(build-module)
+# This is not only not in libc, it's not even linked with it.
+CFLAGS-tst-putenvmod.c += $(no-stack-protector)
+
libof-tst-putenvmod = extramodules
$(objpfx)bug-getcontext: $(libm)
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 6d99284..fbe138f 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -46,6 +46,9 @@ tests-pie += $(quad-pie-test)
test-extras += tst-quadmod1pie tst-quadmod2pie
extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
+CFLAGS-tst-quad1pie.c = $(no-stack-protector)
+CFLAGS-tst-quad2pie.c = $(no-stack-protector)
+
$(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
$(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
--
2.10.1.208.gbec66bc