Skip to content

Commit d8552ac

Browse files
committed
Eliminate post-processing of bootstrap artefact
In order to be repeatable, the coreboot cycle routinely has to relink both boot artefacts with a fixed configuration. It's not therefore much more of a stretch to link those artefacts with the required flags to suppress both the header (and RNTM section, if applicable) and debugging information. Combined with the previous change to suppress CRCS when the image doesn't use dynamic loading, the coreboot cycle can be accomplished without having to post-process the artefacts with stripdebug.
1 parent acc98ee commit d8552ac

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

Makefile

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -725,13 +725,6 @@ CMPCMD ?= $(OCAMLRUN) tools/cmpbyt$(EXE)
725725

726726
.PHONY: compare
727727
compare:
728-
# The core system has to be rebuilt after bootstrap anyway, so strip ocamlc
729-
# and ocamllex, which means the artefacts should be identical.
730-
mv ocamlc$(EXE) ocamlc.tmp
731-
$(OCAMLRUN) tools/stripdebug$(EXE) -all ocamlc.tmp ocamlc$(EXE)
732-
mv lex/ocamllex$(EXE) ocamllex.tmp
733-
$(OCAMLRUN) tools/stripdebug$(EXE) -all ocamllex.tmp lex/ocamllex$(EXE)
734-
rm -f ocamllex.tmp ocamlc.tmp
735728
@if $(CMPCMD) boot/ocamlc ocamlc$(EXE) \
736729
&& $(CMPCMD) boot/ocamllex lex/ocamllex$(EXE); \
737730
then echo "Fixpoint reached, bootstrap succeeded."; \
@@ -742,12 +735,10 @@ compare:
742735

743736
# Promote a compiler
744737

745-
PROMOTE ?= cp
746-
747738
.PHONY: promote-common
748739
promote-common:
749-
$(PROMOTE) ocamlc$(EXE) boot/ocamlc
750-
$(PROMOTE) lex/ocamllex$(EXE) boot/ocamllex
740+
cp ocamlc$(EXE) boot/ocamlc
741+
cp lex/ocamllex$(EXE) boot/ocamllex
751742
cd stdlib; cp $(LIBFILES) ../boot
752743

753744
# Promote the newly compiled system to the rank of cross compiler
@@ -758,7 +749,6 @@ promote-cross: promote-common
758749
# Promote the newly compiled system to the rank of bootstrap compiler
759750
# (Runs on the new runtime, produces code for the new runtime)
760751
.PHONY: promote
761-
promote: PROMOTE = $(OCAMLRUN) tools/stripdebug$(EXE) -all
762752
promote: promote-common
763753
rm -f boot/ocamlrun$(EXE)
764754
cp runtime/ocamlrun$(EXE) boot/ocamlrun$(EXE)
@@ -972,7 +962,8 @@ ocamlc_SOURCES = driver/main.mli driver/main.ml
972962
ocamlc_BYTECODE_LINKFLAGS = -compat-32 -g
973963

974964
ifeq "$(IN_COREBOOT_CYCLE)" "true"
975-
ocamlc_BYTECODE_LINKFLAGS += -set-runtime-default standard_library_default=.
965+
ocamlc_BYTECODE_LINKFLAGS += \
966+
-no-g -without-runtime -set-runtime-default standard_library_default=.
976967
endif
977968

978969
partialclean::
@@ -1718,7 +1709,8 @@ ocamllex.opt: ocamlopt
17181709
ocamllex_BYTECODE_LINKFLAGS = -compat-32
17191710

17201711
ifeq "$(IN_COREBOOT_CYCLE)" "true"
1721-
ocamllex_BYTECODE_LINKFLAGS += -set-runtime-default standard_library_default=.
1712+
ocamllex_BYTECODE_LINKFLAGS += \
1713+
-no-g -without-runtime -set-runtime-default standard_library_default=.
17221714
endif
17231715

17241716
partialclean::

boot/ocamlc

3.34 KB
Binary file not shown.

boot/ocamllex

-2.06 KB
Binary file not shown.

0 commit comments

Comments
 (0)