This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[vta/trunk?] simplify lib changes detection with bootstrap4-debug
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 05 Nov 2007 07:00:24 -0200
- Subject: [vta/trunk?] simplify lib changes detection with bootstrap4-debug
This uglyish hack short-circuits the build of host tools for stageb4g
(bootstrap4-debug), using the tools built in stageb3g2, and then
modifies the specs file of stageb4g-gcc so as to disable or modify the
debug-info (or other) options passed from the compiler driver to the
compiler proper. The intended use case is:
.../configure ...; make bootstrap-debug; \
make prepare-bootstrap4-debug-lib-$which; \
make bootstrap4-debug; \
rm compare3-debug; make compare3-debug
where $which can be replaced with:
* g0, to build the bootstrap4-debug libraries with -g0;
* novta, to build them with -fno-var-tracking-assignments. ATM this
makes sense only in the vta branch, where the option exists and its
opposite is the default; Or
* custom, to build them after an arbitrary transformation in the spec
file, specified through a Makefile macro set to a sed script. Maybe
I could do away with this and then we could just use
prepare-bootstrap-debug-lib, and then tweak the specs file by hand?
Thoughts? Is this useful for the trunk, without the vta-specific
bits, along with the two other top-level compare and bootstrap-debug
patches I've just posted?
for ChangeLog.vta
from Alexandre Oliva <aoliva@redhat.com>
* Makefile.tpl (bootstrap4-debug-init): New macro.
(bootstrap4-debug-lib-gcc-clean): New macro.
(cp-lR): New macro.
(prepare-bootstrap4-debug-lib): New target.
(clean-bootstrap4-debug-lib): New target.
(sed-script-prepare-bootstrap4-debug-lib-g0): New macro.
(sed-script-prepare-bootstrap4-debug-lib-novta): New macro.
(sed-script-prepare-bootstrap4-debug-lib-custom): New macro.
(prepare-bootstrap4-debug-lib-g0): New target.
(prepare-bootstrap4-debug-lib-novta): New target.
(prepare-bootstrap4-debug-lib-custom): New target.
* Makefile.in: Rebuilt.
Index: Makefile.tpl
===================================================================
--- Makefile.tpl.orig 2007-11-03 04:44:12.000000000 -0200
+++ Makefile.tpl 2007-11-05 04:19:36.000000000 -0200
@@ -1609,6 +1609,53 @@ configure-gdb: $(CONFIGURE_GDB_TK)
all-gdb: $(gdbnlmrequirements) $(GDB_TK)
install-gdb: $(INSTALL_GDB_TK)
+@if gcc-bootstrap
+bootstrap4-debug-init = stgsrc=stageb3g2 stgdst=stageb4g
+bootstrap4-debug-lib-gcc-clean = stamp-gnatlib* stamp-tools ada/rts
+
+cp-lR = cp -lR
+
+.PHONY: prepare-bootstrap4-debug-lib
+prepare-bootstrap4-debug-lib:
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ : $(MAKE); $(stage); \
+ $(bootstrap4-debug-init) didgcc=false; \
+ for d3 in $$stgsrc-*; do \
+ case $$d3 in "$$stgsrc-$(TARGET_SUBDIR)") continue ;; esac; \
+ d4=`echo $$d3 | sed s,^$$stgsrc,$$stgdst,`; \
+ if test -d $$d4; then \
+ echo $$d4 already set up, skipping...; \
+ continue; \
+ fi; \
+ d4t=$$d4.tmp; \
+ rm -rf $$d4t || :; \
+ $(cp-lR) $$d3/. $$d4t; \
+ case $$d3 in "$$stgsrc-gcc") \
+ (cd $$d4t && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :;; \
+ esac; \
+ mv $$d4t $$d4; \
+ done
+
+.PHONY: clean-bootstrap4-debug-lib
+clean-bootstrap4-debug-lib: prepare-bootstrap4-debug-lib
+ @$(bootstrap4-debug-init); \
+ rm -rf $$stgdst-$(TARGET_SUBDIR) || :; \
+ (cd $$stgdst-gcc && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :
+
+sed-script-prepare-bootstrap4-debug-lib-g0 = 's,%{g\*},,'
+sed-script-prepare-bootstrap4-debug-lib-novta = 's,%{g\*},& %{!fvar-tracking-assignments:%{!fno-var-tracking-assignments:-fno-var-tracking-assignments}},'
+sed-script-prepare-bootstrap4-debug-lib-custom = 's,x,x,'
+
+.PHONY: prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta prepare-bootstrap4-debug-lib-custom
+prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta \
+prepare-bootstrap4-debug-lib-custom: prepare-bootstrap4-debug-lib
+ @$(bootstrap4-debug-init); \
+ rm -f $$stgdst-gcc/specs; \
+ sed $(sed-script-$@) < $$stgsrc-gcc/specs > $$stgdst-gcc/specs
+
+@endif gcc-bootstrap
+
# Serialization dependencies. Host configures don't work well in parallel to
# each other, due to contention over config.cache. Target configures and
# build configures are similar.
Index: Makefile.in
===================================================================
--- Makefile.in.orig 2007-11-03 04:44:12.000000000 -0200
+++ Makefile.in 2007-11-05 04:19:50.000000000 -0200
@@ -53247,6 +53247,53 @@ configure-gdb: $(CONFIGURE_GDB_TK)
all-gdb: $(gdbnlmrequirements) $(GDB_TK)
install-gdb: $(INSTALL_GDB_TK)
+@if gcc-bootstrap
+bootstrap4-debug-init = stgsrc=stageb3g2 stgdst=stageb4g
+bootstrap4-debug-lib-gcc-clean = stamp-gnatlib* stamp-tools ada/rts
+
+cp-lR = cp -lR
+
+.PHONY: prepare-bootstrap4-debug-lib
+prepare-bootstrap4-debug-lib:
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ : $(MAKE); $(stage); \
+ $(bootstrap4-debug-init) didgcc=false; \
+ for d3 in $$stgsrc-*; do \
+ case $$d3 in "$$stgsrc-$(TARGET_SUBDIR)") continue ;; esac; \
+ d4=`echo $$d3 | sed s,^$$stgsrc,$$stgdst,`; \
+ if test -d $$d4; then \
+ echo $$d4 already set up, skipping...; \
+ continue; \
+ fi; \
+ d4t=$$d4.tmp; \
+ rm -rf $$d4t || :; \
+ $(cp-lR) $$d3/. $$d4t; \
+ case $$d3 in "$$stgsrc-gcc") \
+ (cd $$d4t && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :;; \
+ esac; \
+ mv $$d4t $$d4; \
+ done
+
+.PHONY: clean-bootstrap4-debug-lib
+clean-bootstrap4-debug-lib: prepare-bootstrap4-debug-lib
+ @$(bootstrap4-debug-init); \
+ rm -rf $$stgdst-$(TARGET_SUBDIR) || :; \
+ (cd $$stgdst-gcc && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :
+
+sed-script-prepare-bootstrap4-debug-lib-g0 = 's,%{g\*},,'
+sed-script-prepare-bootstrap4-debug-lib-novta = 's,%{g\*},& %{!fvar-tracking-assignments:%{!fno-var-tracking-assignments:-fno-var-tracking-assignments}},'
+sed-script-prepare-bootstrap4-debug-lib-custom = 's,x,x,'
+
+.PHONY: prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta prepare-bootstrap4-debug-lib-custom
+prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta \
+prepare-bootstrap4-debug-lib-custom: prepare-bootstrap4-debug-lib
+ @$(bootstrap4-debug-init); \
+ rm -f $$stgdst-gcc/specs; \
+ sed $(sed-script-$@) < $$stgsrc-gcc/specs > $$stgdst-gcc/specs
+
+@endif gcc-bootstrap
+
# Serialization dependencies. Host configures don't work well in parallel to
# each other, due to contention over config.cache. Target configures and
# build configures are similar.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}