94084c
commit 1fe4b8d6937139faa47410552d4e21b356810d67
94084c
Author: Joseph Myers <joseph@codesourcery.com>
94084c
Date:   Fri Sep 17 19:24:14 2021 +0000
94084c
94084c
    Use $(pie-default) with conformtest
94084c
    
94084c
    My glibc bot showed that my conformtest changes fail the build of the
94084c
    conformtest execution tests for x86_64-linux-gnu-static-pie, because
94084c
    linking the newly built object with the newly built libc and the
94084c
    associated options normally used for linking requires it to be built
94084c
    as PIE.  Add $(pie-default) to the compiler command used so that PIE
94084c
    options are used when required.
94084c
    
94084c
    There's a case for using the whole of $(CFLAGS-.o) (which includes
94084c
    $(pie-default)), but that raises questions of any impact from using
94084c
    optimization flags from CFLAGS in these tests.  So for now just use
94084c
    $(pie-default) as the key part of $(CFLAGS-.o) that's definitely
94084c
    needed.
94084c
    
94084c
    Tested with build-many-glibcs.py for x86_64-linux-gnu-static-pie.
94084c
    
94084c
    (cherry picked from commit 885762aa31d75de8b9fea4c0e2e372b582d4c548)
94084c
94084c
diff --git a/conform/Makefile b/conform/Makefile
94084c
index 296db818f0a72253..27ad98caf866879f 100644
94084c
--- a/conform/Makefile
94084c
+++ b/conform/Makefile
94084c
@@ -175,7 +175,8 @@ $(conformtest-header-tests): $(objpfx)%/conform.out: \
94084c
 			     conformtest.py $(conformtest-headers-data)
94084c
 	(set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
94084c
 	 mkdir -p $(@D); \
94084c
-	 $(PYTHON) $< --cc='$(CC)' --flags='$(conformtest-cc-flags)' \
94084c
+	 $(PYTHON) $< --cc='$(CC) $(pie-default)' \
94084c
+		   --flags='$(conformtest-cc-flags)' \
94084c
 		   --ldflags='$(+link-tests-before-inputs)' \
94084c
 		   --libs='$(+link-tests-after-inputs)' \
94084c
 		   --run-program-prefix='$(run-program-prefix)' \