toplevel: don't override gettext-runtime/configure-discovered build args

Message ID 20231221193243.368541-1-arsen@aarsen.me
State New
Headers
Series toplevel: don't override gettext-runtime/configure-discovered build args |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Arsen Arsenović Dec. 21, 2023, 7:19 p.m. UTC
  ChangeLog:
	PR bootstrap/112534
	* Makefile.def (host-gettext): Set all_args_override="".
	* Makefile.in: Regenerate.
	* Makefile.tpl (all--args): Define as a helper macro for
	computing extra arguments to make.
	(all): Use all--args over args.
---
Hi,

This patch fixes the build failure noted in PR112534 by preventing the
build system from overriding the compiler flags the gettext-runtime
subconfigure discovers.

This would appear to keep bootstrap working correctly, as shown in:

  [arsen@gcc2-power8 build2]$ readelf -p .comment */intl/dcgettext.o

  File: gettext/intl/dcgettext.o

  String dump of section '.comment':
    [     1]  GCC: (GNU) 14.0.0 20231220 (experimental)


  File: prev-gettext/intl/dcgettext.o

  String dump of section '.comment':
    [     1]  GCC: (GNU) 14.0.0 20231220 (experimental)


  File: stage1-gettext/intl/dcgettext.o

  String dump of section '.comment':
    [     1]  GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)

Tested on ppc64le-redhat-linux, OK for trunk?

TIA, have a lovely day.

 Makefile.def |  2 ++
 Makefile.in  | 40 +++++++++++++++++++++-------------------
 Makefile.tpl |  8 +++++---
 3 files changed, 28 insertions(+), 22 deletions(-)
  

Comments

Arsen Arsenović Dec. 30, 2023, 12:21 p.m. UTC | #1
Hi,

Ping on this patch.

TIA, have a lovely day and happy holidays!
--
Arsen Arsenović
  
Arsen Arsenović Jan. 15, 2024, 9:52 p.m. UTC | #2
Evening folks,

Hope you had wonderful holidays.

Gentle ping on this patch.

Have a lovely night!
--
Arsen Arsenović
  

Patch

diff --git a/Makefile.def b/Makefile.def
index 3f8962c28032..93222bfd7a4b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -76,6 +76,8 @@  host_modules= { module= gprof; };
 host_modules= { module= gprofng; };
 host_modules= { module= gettext; bootstrap=true; no_install=true;
                 module_srcdir= "gettext/gettext-runtime";
+		// Don't override configure-discovered build arguments
+		all_args_override="";
 		// We always build gettext with pic, because some packages (e.g. gdbserver)
 		// need it in some configuratons, which is determined via nontrivial tests.
 		// Always enabling pic seems to make sense for something tied to
diff --git a/Makefile.in b/Makefile.in
index c6313048c914..e67a50750c76 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3168,6 +3168,8 @@  TAGS: do-TAGS
 
 
 
+
+
 # --------------------------------------
 # Modules which run on the build machine
 # --------------------------------------
@@ -20189,7 +20191,7 @@  all-gettext: configure-gettext
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(HOST_EXPORTS)  \
 	(cd $(HOST_SUBDIR)/gettext && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS)  \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS)  $(STAGE1_FLAGS_TO_PASS)  \
 		$(TARGET-gettext))
 @endif gettext
 
@@ -20219,7 +20221,7 @@  all-stage1-gettext: configure-stage1-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS)  \
+		  \
 		$(STAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGE1_TFLAGS)"  \
 		$(TARGET-stage1-gettext)
@@ -20234,7 +20236,7 @@  clean-stage1-gettext:
 	  $(MAKE) stage1-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS)  \
+	$(MAKE)   \
 	$(STAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
@@ -20264,7 +20266,7 @@  all-stage2-gettext: configure-stage2-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGE2_TFLAGS)"  \
 		$(TARGET-stage2-gettext)
 
@@ -20278,7 +20280,7 @@  clean-stage2-gettext:
 	  $(MAKE) stage2-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20307,7 +20309,7 @@  all-stage3-gettext: configure-stage3-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGE3_TFLAGS)"  \
 		$(TARGET-stage3-gettext)
 
@@ -20321,7 +20323,7 @@  clean-stage3-gettext:
 	  $(MAKE) stage3-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20350,7 +20352,7 @@  all-stage4-gettext: configure-stage4-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGE4_TFLAGS)"  \
 		$(TARGET-stage4-gettext)
 
@@ -20364,7 +20366,7 @@  clean-stage4-gettext:
 	  $(MAKE) stage4-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20393,7 +20395,7 @@  all-stageprofile-gettext: configure-stageprofile-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGEprofile_TFLAGS)"  \
 		$(TARGET-stageprofile-gettext)
 
@@ -20407,7 +20409,7 @@  clean-stageprofile-gettext:
 	  $(MAKE) stageprofile-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20436,7 +20438,7 @@  all-stagetrain-gettext: configure-stagetrain-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGEtrain_TFLAGS)"  \
 		$(TARGET-stagetrain-gettext)
 
@@ -20450,7 +20452,7 @@  clean-stagetrain-gettext:
 	  $(MAKE) stagetrain-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20479,7 +20481,7 @@  all-stagefeedback-gettext: configure-stagefeedback-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGEfeedback_TFLAGS)"  \
 		$(TARGET-stagefeedback-gettext)
 
@@ -20493,7 +20495,7 @@  clean-stagefeedback-gettext:
 	  $(MAKE) stagefeedback-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20522,7 +20524,7 @@  all-stageautoprofile-gettext: configure-stageautoprofile-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGEautoprofile_TFLAGS)"  \
 		$(TARGET-stageautoprofile-gettext)
 
@@ -20536,7 +20538,7 @@  clean-stageautoprofile-gettext:
 	  $(MAKE) stageautoprofile-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
@@ -20565,7 +20567,7 @@  all-stageautofeedback-gettext: configure-stageautofeedback-gettext
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 $(POSTSTAGE1_FLAGS_TO_PASS)  \
 		TFLAGS="$(STAGEautofeedback_TFLAGS)" PERF_DATA=perf.data \
 		$(TARGET-stageautofeedback-gettext)
 
@@ -20579,7 +20581,7 @@  clean-stageautofeedback-gettext:
 	  $(MAKE) stageautofeedback-start; \
 	fi; \
 	cd $(HOST_SUBDIR)/gettext && \
-	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+	$(MAKE)  $(POSTSTAGE1_FLAGS_TO_PASS)  clean
 @endif gettext-bootstrap
 
 
diff --git a/Makefile.tpl b/Makefile.tpl
index 6e22adecd2f1..2c9226af74da 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -1258,6 +1258,8 @@  configure-stage[+id+]-[+prefix+][+module+]:
 [+ ENDIF bootstrap +]
 [+ ENDDEF +]
 
+[+ DEFINE all--args +][+ (get "all_args_override" (get "args")) +][+ ENDDEF +]
+
 [+ DEFINE all +]
 .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
 maybe-all-[+prefix+][+module+]:
@@ -1274,7 +1276,7 @@  all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELS
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	[+exports+] [+extra_exports+] \
 	(cd [+subdir+]/[+module+] && \
-	  $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) [+all--args+] [+stage1_args+] [+extra_make_flags+] \
 		$(TARGET-[+prefix+][+module+]))
 @endif [+prefix+][+module+]
 
@@ -1309,7 +1311,7 @@  all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
 		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
 		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
 		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-		[+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
+		[+all--args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
 		[+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
 		TFLAGS="$(STAGE[+id+]_TFLAGS)" [+profile_data+] \
 		$(TARGET-stage[+id+]-[+prefix+][+module+])
@@ -1324,7 +1326,7 @@  clean-stage[+id+]-[+prefix+][+module+]:
 	  $(MAKE) stage[+id+]-start; \
 	fi; \
 	cd [+subdir+]/[+module+] && \
-	$(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
+	$(MAKE) [+all--args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
 	[+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
 @endif [+prefix+][+module+]-bootstrap