From 6ce817b0c65b5093699dcf163f7e5b36bedcbc05 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Fri, 25 Mar 2022 01:15:46 +0900 Subject: [PATCH] build: allow `Make.user` to tweak bootstrap debug level (#44728) The `-g1` option for bootstrapping is especially useful to get Julia-level stacktrace in a case when some hard-to-debug error happened inside `Core.Compiler`. Now we can define to enable it locally without modification on Make.inc: > Make.user ``` BOOTSTRAP_DEBUG_LEVEL=1 ``` --- Make.inc | 3 +++ sysimage.mk | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Make.inc b/Make.inc index d315dfd0c6742..424303e987256 100644 --- a/Make.inc +++ b/Make.inc @@ -21,6 +21,9 @@ JULIA_PRECOMPILE ?= 1 # and LLVM_ASSERTIONS=1. FORCE_ASSERTIONS ?= 0 +# Set BOOTSTRAP_DEBUG_LEVEL to 1 to enable Julia-level stacktrace during bootstrapping. +BOOTSTRAP_DEBUG_LEVEL ?= 0 + # OPENBLAS build options OPENBLAS_TARGET_ARCH:= OPENBLAS_SYMBOLSUFFIX:= diff --git a/sysimage.mk b/sysimage.mk index 1586eb7dbc16d..2d154672d8130 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -60,7 +60,7 @@ RELBUILDROOT := $(call rel_path,$(JULIAHOME)/base,$(BUILDROOT)/base)/ # <-- make $(build_private_libdir)/corecompiler.ji: $(COMPILER_SRCS) @$(call PRINT_JULIA, cd $(JULIAHOME)/base && \ $(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" --output-ji $(call cygpath_w,$@).tmp \ - --startup-file=no --warn-overwrite=yes -g0 -O0 compiler/compiler.jl) + --startup-file=no --warn-overwrite=yes -g$(BOOTSTRAP_DEBUG_LEVEL) -O0 compiler/compiler.jl) @mv $@.tmp $@ $(build_private_libdir)/sys.ji: $(build_private_libdir)/corecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS)