This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix -Wundef warnings in elf/tst-execstack.c

To remove -Wno-error=undef, we need to fix the remaining cases where
there are -Wundef warnings in the testsuite.  One of those places is
in elf/tst-execstack.c.

tst-execstack.c tests USE_PTHREADS with #if.  nptl/tst-execstack.c
defines USE_PTHREADS to 1 before including ../elf/tst-execstack.c,
while elf/tst-execstack.c, when compiled directly, leaves it

This patch adds a setting of CPPFLAGS-tst-execstack.c to
elf/Makefile.  An alternative approach would be to rename
tst-execstack.c to tst-execstack-main.c and have two different
tst-execstack.c files include it, each with an appropriate

Tested for x86_64.

2015-08-17  Joseph Myers  <>

	* elf/Makefile [$(have-z-execstack) = yes]
	(CPPFLAGS-tst-execstack.c): New variable.

diff --git a/elf/Makefile b/elf/Makefile
index 71a18a1..e791901 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -874,6 +874,7 @@ endif
 ifeq ($(have-z-execstack),yes)
 $(objpfx)tst-execstack: $(libdl)
 $(objpfx)tst-execstack.out: $(objpfx)
+CPPFLAGS-tst-execstack.c = -DUSE_PTHREADS=0
 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
 LDFLAGS-tst-execstack-mod = -Wl,-z,execstack

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]