]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix -Wundef warnings in elf/tst-execstack.c.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 19 Aug 2015 00:51:07 +0000 (00:51 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 19 Aug 2015 00:51:07 +0000 (00:51 +0000)
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
undefined.

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
USE_PTHREADS #define.

Tested for x86_64.

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

ChangeLog
elf/Makefile

index da9a3e08511cdf65e0a0ec2cb7b1cc2aa1054d10..7b8181eb44a22629105062961dd8d87424f4ed09 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-08-19  Joseph Myers  <joseph@codesourcery.com>
 
+       * elf/Makefile [$(have-z-execstack) = yes]
+       (CPPFLAGS-tst-execstack.c): New variable.
+
        * login/tst-utmp.c [_HAVE_UT_TYPE || defined UTMPX]: Change
        conditional to [defined UTMPX || _HAVE_UT_TYPE].
        [_HAVE_UT_TV || defined UTMPX]: Change conditional to [defined
index 71a18a1ec4483413581689a6cc29526026c31e8e..e791901498377fb08e2ea67e0e6d8bd4c7fc94b6 100644 (file)
@@ -874,6 +874,7 @@ endif
 ifeq ($(have-z-execstack),yes)
 $(objpfx)tst-execstack: $(libdl)
 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
+CPPFLAGS-tst-execstack.c = -DUSE_PTHREADS=0
 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
 LDFLAGS-tst-execstack-mod = -Wl,-z,execstack