Check that native-code is supported in world.opt
Previously, if the native-code compiler is not supported (e.g. because configure doesn't recognize the target architecture, or is run with --disable-native-compiler), "make world.opt" fails late and with a mysterious error message (a warning about undeclared C functions in runtime/roots_nat.c or runtime/backtrace_nat.c, typically). This commit ensures that "make world.opt", "make opt" and "make opt.opt" fail immediately with a meaningful error message if the native-code compiler is not supported. Note: in "world.opt", make sure that "checknative" is run, and only then "coldstart"; don't run them in parallel.master
parent
c107e00ce5
commit
01f2ac8d70
17
Makefile
17
Makefile
|
@ -401,7 +401,7 @@ opt-core: runtimeopt
|
|||
$(MAKE) libraryopt
|
||||
|
||||
.PHONY: opt
|
||||
opt:
|
||||
opt: checknative
|
||||
$(MAKE) runtimeopt
|
||||
$(MAKE) ocamlopt
|
||||
$(MAKE) libraryopt
|
||||
|
@ -409,7 +409,7 @@ opt:
|
|||
|
||||
# Native-code versions of the tools
|
||||
.PHONY: opt.opt
|
||||
opt.opt:
|
||||
opt.opt: checknative
|
||||
$(MAKE) checkstack
|
||||
$(MAKE) runtime
|
||||
$(MAKE) core
|
||||
|
@ -464,7 +464,8 @@ world: coldstart
|
|||
|
||||
# Compile also native code compiler and libraries, fast
|
||||
.PHONY: world.opt
|
||||
world.opt: coldstart
|
||||
world.opt: checknative
|
||||
$(MAKE) coldstart
|
||||
$(MAKE) opt.opt
|
||||
|
||||
# FlexDLL sources missing error messages
|
||||
|
@ -1130,6 +1131,16 @@ ocamldebugger: ocamlc ocamlyacc ocamllex otherlibraries
|
|||
partialclean::
|
||||
$(MAKE) -C debugger clean
|
||||
|
||||
# Check that the native-code compiler is supported
|
||||
.PHONY: checknative
|
||||
checknative:
|
||||
ifeq "$(ARCH)" "none"
|
||||
checknative:
|
||||
$(error The native-code compiler is not supported on this platform)
|
||||
else
|
||||
@
|
||||
endif
|
||||
|
||||
# Check that the stack limit is reasonable (Unix-only)
|
||||
.PHONY: checkstack
|
||||
checkstack:
|
||||
|
|
Loading…
Reference in New Issue