From de857d6fb95b72ee17ac7b61b777edb642a172c5 Mon Sep 17 00:00:00 2001 From: alainfrisch Date: Thu, 10 Mar 2016 10:46:19 +0100 Subject: [PATCH] GPR#324: Make boot/ocamlc read directly byterun/primitives (patch by Francois Bobot). --- Changes | 11 +++++++++++ Makefile | 2 +- Makefile.nt | 2 +- Makefile.shared | 2 +- byterun/Makefile.common | 2 +- lex/Makefile | 2 +- lex/Makefile.nt | 2 +- stdlib/Makefile.shared | 5 +++-- tools/Makefile.shared | 2 +- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index cfa5b94d9..40bc87b32 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,14 @@ +OCaml 4.04.0: +------------- + +(Changes that can break existing programs are marked with a "*") + +Build system: +- GPR#324: Compiler developpers only: Adding new primitives to the + standard runtime doesn't require anymore to run `make bootstrap` + (François Bobot) + + OCaml 4.03.0: ------------- diff --git a/Makefile b/Makefile index 912046178..4ebf2f015 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ coldstart: cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE) cd yacc; $(MAKE) all cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE) - cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all + cd stdlib; $(MAKE) COMPILER="../boot/ocamlc -use-prims ../byterun/primitives" all cd stdlib; cp $(LIBFILES) ../boot if test -f boot/libcamlrun.a; then :; else \ ln -s ../byterun/libcamlrun.a boot/libcamlrun.a; fi diff --git a/Makefile.nt b/Makefile.nt index 079fca74b..a5397daff 100644 --- a/Makefile.nt +++ b/Makefile.nt @@ -115,7 +115,7 @@ coldstart: cp byterun/ocamlrun.exe boot/ocamlrun.exe cd yacc ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) all cp yacc/ocamlyacc.exe boot/ocamlyacc.exe - cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) COMPILER=../boot/ocamlc all + cd stdlib ; $(MAKEREC) $(BOOT_FLEXLINK_CMD) COMPILER="../boot/ocamlc -use-prims ../byterun/primitives" all cd stdlib ; cp $(LIBFILES) ../boot # Build the core system: the minimum needed to make depend and bootstrap diff --git a/Makefile.shared b/Makefile.shared index fe98260de..3e0d89f2b 100755 --- a/Makefile.shared +++ b/Makefile.shared @@ -20,7 +20,7 @@ CAMLRUN ?= boot/ocamlrun CAMLYACC ?= boot/ocamlyacc include stdlib/StdlibModules -CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot +CAMLC=$(CAMLRUN) boot/ocamlc -g -nostdlib -I boot -use-prims byterun/primitives CAMLOPT=$(CAMLRUN) ./ocamlopt -g -nostdlib -I stdlib -I otherlibs/dynlink COMPFLAGS=-strict-sequence -principal -w +33..39+48+50 -warn-error A \ -bin-annot -safe-string -strict-formats $(INCLUDES) diff --git a/byterun/Makefile.common b/byterun/Makefile.common index 5bcd6779a..80a2dcbd7 100644 --- a/byterun/Makefile.common +++ b/byterun/Makefile.common @@ -41,7 +41,7 @@ PUBLIC_INCLUDES=\ version.h -all:: ocamlrun$(EXE) ld.conf libcamlrun.$(A) all-$(RUNTIMED) +all:: ocamlrun$(EXE) ld.conf libcamlrun.$(A) all-$(RUNTIMED) primitives .PHONY: all all-noruntimed: diff --git a/lex/Makefile b/lex/Makefile index fefaaa2c1..8b0cc2c17 100644 --- a/lex/Makefile +++ b/lex/Makefile @@ -18,7 +18,7 @@ include ../config/Makefile CAMLRUN ?= ../boot/ocamlrun CAMLYACC ?= ../boot/ocamlyacc -CAMLC=$(CAMLRUN) ../boot/ocamlc -strict-sequence -nostdlib -I ../boot +CAMLC=$(CAMLRUN) ../boot/ocamlc -strict-sequence -nostdlib -I ../boot -use-prims ../byterun/primitives CAMLOPT=$(CAMLRUN) ../ocamlopt -nostdlib -I ../stdlib COMPFLAGS=-w +33..39 -warn-error A -bin-annot -safe-string LINKFLAGS= diff --git a/lex/Makefile.nt b/lex/Makefile.nt index 44384c777..514e9f7ae 100644 --- a/lex/Makefile.nt +++ b/lex/Makefile.nt @@ -19,7 +19,7 @@ include ../config/Makefile CAMLRUN ?= ../boot/ocamlrun CAMLYACC ?= ../boot/ocamlyacc -CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot +CAMLC=$(CAMLRUN) ../boot/ocamlc -I ../boot -use-prims ../byterun/primitives ifeq "$(wildcard ../flexdll/Makefile)" "" FLEXLINK_ENV= else diff --git a/stdlib/Makefile.shared b/stdlib/Makefile.shared index c8769b56c..711264fe6 100755 --- a/stdlib/Makefile.shared +++ b/stdlib/Makefile.shared @@ -107,8 +107,9 @@ clean:: -p -c -o $*.p.cmx $< # Dependencies on the compiler -$(OBJS) std_exit.cmo: $(COMPILER) -$(OBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER) +COMPILER_DEPS=$(filter-out -use-prims, $(COMPILER)) +$(OBJS) std_exit.cmo: $(COMPILER_DEPS) +$(OBJS:.cmo=.cmi) std_exit.cmi: $(COMPILER_DEPS) $(OBJS:.cmo=.cmx) std_exit.cmx: $(OPTCOMPILER) $(OBJS:.cmo=.p.cmx) std_exit.p.cmx: $(OPTCOMPILER) diff --git a/tools/Makefile.shared b/tools/Makefile.shared index ecf8d23a0..e2db2cd04 100644 --- a/tools/Makefile.shared +++ b/tools/Makefile.shared @@ -17,7 +17,7 @@ include ../config/Makefile CAMLRUN ?= ../boot/ocamlrun CAMLYACC ?= ../boot/ocamlyacc -CAMLC=$(CAMLRUN) ../boot/ocamlc -nostdlib -I ../boot +CAMLC=$(CAMLRUN) ../boot/ocamlc -nostdlib -I ../boot -use-prims ../byterun/primitives CAMLOPT=$(CAMLRUN) ../ocamlopt -nostdlib -I ../stdlib CAMLLEX=$(CAMLRUN) ../boot/ocamllex INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \