Skip to content

Commit

Permalink
build: allow Make.user to tweak bootstrap debug level (JuliaLang#44728
Browse files Browse the repository at this point in the history
)

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
```
  • Loading branch information
aviatesk authored Mar 24, 2022
1 parent 424785a commit 6ce817b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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:=
Expand Down
2 changes: 1 addition & 1 deletion sysimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6ce817b

Please sign in to comment.