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