]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix failing pretty printer tests when CPPFLAGS has optimizations.
authorCarlos O'Donell <carlos@redhat.com>
Fri, 23 Dec 2016 18:46:56 +0000 (13:46 -0500)
committerCarlos O'Donell <carlos@redhat.com>
Fri, 23 Dec 2016 18:46:56 +0000 (13:46 -0500)
The value of CPPFLAGS provided by the environment may have optimizations
that interfere with the pretty printer test requirements. To override
such optimizations the pretty printer tests must also specify CPPFLAGS.
The existing pretty printer tests are fixed and the
README.pretty-printers is updated with the new requirement.

ChangeLog
README.pretty-printers
nptl/Makefile
nptl/test-condattr-printers.c

index 48ea5d8bcc80c709ef5cd0039b8de2c660f9fce2..0dd96f2d0f2917c4a0a4e2bfab4d8f2922478ec1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2016-12-24  Carlos O'Donell  <carlos@redhat.com>
 
+       * README.pretty-printers: Must specify CPPFLAGS-* also.
+       * nptl/Makefile (CPPFLAGS-test-mutexattr-printers.c): Define.
+       (CPPFLAGS-test-mutex-printers.c): Define.
+       (CPPFLAGS-test-condattr-printers.c): Define.
+       (CPPFLAGS-test-cond-printers.c): Define.
+       (CPPFLAGS-test-rwlockattr-printers.c): Define.
+       (CPPFLAGS-test-rwlock-printers.c): Define.
+
        * nss/Makefile [ifeq (yes,$(have-thread-library))]
        (tests): Add tst-cancel-getpwuid_r.
        * nss/tst-cancel-getpwuid_r.c: New file.
index 86629001e651485eadeea8717a0c8c56692024f4..a2536cad8015fc16bdc80bf428650fe032efbe21 100644 (file)
@@ -126,11 +126,12 @@ You can use the existing unit tests as examples.
 
 4. Add the names of the pretty printer tests to the 'tests-printers' variable
 in your submodule's Makefile (without extensions).  In addition, for each test
-program you must define a corresponding CFLAGS-* variable and set it to
-$(CFLAGS-printers-tests) to ensure they're compiled correctly.  For example,
-test-foo-printer.c requires the following:
+program you must define a corresponding CFLAGS-* and CPPFLAGS-* variable and
+set it to $(CFLAGS-printers-tests) to ensure they're compiled correctly.  For
+example, test-foo-printer.c requires the following:
 
 CFLAGS-test-foo-printer.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-foo-printer.c := $(CFLAGS-printers-tests)
 
 Finally, if your programs need to be linked with a specific library, you can add
 its name to the 'tests-printers-libs' variable in your submodule's Makefile.
index 7ac91969751d567bcf646acb141dc28c2fedd55d..bed5babfd932910fb2e3e852bf1649b7e2528198 100644 (file)
@@ -318,12 +318,22 @@ tests-printers := test-mutexattr-printers test-mutex-printers \
                  test-condattr-printers test-cond-printers \
                  test-rwlockattr-printers test-rwlock-printers
 
+# We must specify both CFLAGS and CPPFLAGS to override any
+# compiler options the user might have provided that conflict
+# with what we need e.g. user specifies CPPFLAGS with -O2 and
+# we need -O0.
 CFLAGS-test-mutexattr-printers.c := $(CFLAGS-printers-tests)
 CFLAGS-test-mutex-printers.c := $(CFLAGS-printers-tests)
 CFLAGS-test-condattr-printers.c := $(CFLAGS-printers-tests)
 CFLAGS-test-cond-printers.c := $(CFLAGS-printers-tests)
 CFLAGS-test-rwlockattr-printers.c := $(CFLAGS-printers-tests)
 CFLAGS-test-rwlock-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-mutexattr-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-mutex-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-condattr-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-cond-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-rwlockattr-printers.c := $(CFLAGS-printers-tests)
+CPPFLAGS-test-rwlock-printers.c := $(CFLAGS-printers-tests)
 
 ifeq ($(build-shared),yes)
 tests-printers-libs := $(shared-thread-library)
index 4db40988272b056e42724815e33db6f1533fb67b..2815d02101acee10a7ed63026c79915da15d99da 100644 (file)
@@ -66,6 +66,7 @@ condvar_reinit (pthread_cond_t *condvar, const pthread_condattr_t *attr)
 }
 
 /* Tests setting the clock ID attribute.  */
+__attribute__ ((noinline))
 static int
 test_setclock (pthread_cond_t *condvar, pthread_condattr_t *attr)
 {