Makefile: the promote-cross target should use cp rather than stripdebug

The compiler's bootstrap procedure involves calling the promote-cross
target of the root Makefile.

When this target is invoked e.g. in the context of an executable
magic number update, it is actually not possible to use the stripdebug
tool.

Thus, this commit makes sure the promote-cross target uses cp
to promote the bytecode tools, rather than stripdebug.

This is not an issue because in the promote rule used later
during the bootstrap the stripdebug tool can be used, so that the
bytecode executables one gets after a complete bootstrap will remain
small and won't contain any debugging symbol.
master
Sébastien Hinderer 2018-05-16 16:05:36 +02:00
parent 3dede5b345
commit ecb42aa78f
1 changed files with 14 additions and 6 deletions

View File

@ -434,19 +434,27 @@ compare:
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
fi
# Promote a compiler
PROMOTE ?= cp
.PHONY: promote-common
promote-common:
$(PROMOTE) ocamlc boot/ocamlc
$(PROMOTE) lex/ocamllex boot/ocamllex
cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
cd stdlib; cp $(LIBFILES) ../boot
# Promote the newly compiled system to the rank of cross compiler
# (Runs on the old runtime, produces code for the new runtime)
.PHONY: promote-cross
promote-cross:
$(CAMLRUN) tools/stripdebug ocamlc boot/ocamlc
$(CAMLRUN) tools/stripdebug lex/ocamllex boot/ocamllex
cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE)
cd stdlib; cp $(LIBFILES) ../boot
promote-cross: promote-common
# Promote the newly compiled system to the rank of bootstrap compiler
# (Runs on the new runtime, produces code for the new runtime)
.PHONY: promote
promote: promote-cross
promote: PROMOTE = $(CAMLRUN) tools/stripdebug
promote: promote-common
cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE)
# Remove old bootstrap compilers