diff --git a/Compiler/src/Compiler.jl b/Compiler/src/Compiler.jl index 4104b71093f4d..b648fd3f295eb 100644 --- a/Compiler/src/Compiler.jl +++ b/Compiler/src/Compiler.jl @@ -87,14 +87,14 @@ eval(m, x) = Core.eval(m, x) function include(x::String) if !isdefined(Base, :end_base_include) # During bootstrap, all includes are relative to `base/` - x = Base.strcat(Base.strcat(Base.BUILDROOT, "../usr/share/julia/Compiler/src/"), x) + x = Base.strcat(Base.strcat(Base.DATAROOT, "julia/Compiler/src/"), x) end Base.include(Compiler, x) end function include(mod::Module, x::String) if !isdefined(Base, :end_base_include) - x = Base.strcat(Base.strcat(Base.BUILDROOT, "../usr/share/julia/Compiler/src/"), x) + x = Base.strcat(Base.strcat(Base.DATAROOT, "julia/Compiler/src/"), x) end Base.include(mod, x) end diff --git a/base/Base_compiler.jl b/base/Base_compiler.jl index b2633c25eef3f..14edf3e93aad6 100644 --- a/base/Base_compiler.jl +++ b/base/Base_compiler.jl @@ -266,21 +266,25 @@ function strcat(x::String, y::String) return out end -global BUILDROOT::String = "" +BUILDROOT::String = "" +DATAROOT::String = "" baremodule BuildSettings end function process_sysimg_args!() - let i = 1 - global BUILDROOT + let i = 2 # skip file name while i <= length(Core.ARGS) + Core.println(Core.ARGS[i]) if Core.ARGS[i] == "--buildsettings" include(BuildSettings, ARGS[i+1]) - i += 1 + elseif Core.ARGS[i] == "--buildroot" + global BUILDROOT = Core.ARGS[i+1] + elseif Core.ARGS[i] == "--dataroot" + global DATAROOT = Core.ARGS[i+1] else - BUILDROOT = Core.ARGS[i] + error(strcat("invalid sysimage argument: ", Core.ARGS[i])) end - i += 1 + i += 2 end end end @@ -288,7 +292,8 @@ process_sysimg_args!() function isready end -include(strcat(BUILDROOT, "../usr/share/julia/Compiler/src/Compiler.jl")) +include(strcat(DATAROOT, "julia/Compiler/src/Compiler.jl")) + const _return_type = Compiler.return_type diff --git a/sysimage.mk b/sysimage.mk index ceed9657dc807..5371fbd975025 100644 --- a/sysimage.mk +++ b/sysimage.mk @@ -61,18 +61,19 @@ BASE_SRCS := $(sort $(shell find $(JULIAHOME)/base -name \*.jl -and -not -name s $(shell find $(BUILDROOT)/base -name \*.jl -and -not -name sysimg.jl)) STDLIB_SRCS := $(JULIAHOME)/base/sysimg.jl $(SYSIMG_STDLIBS_SRCS) RELBUILDROOT := $(call rel_path,$(JULIAHOME)/base,$(BUILDROOT)/base)/ # <-- make sure this always has a trailing slash +RELDATADIR := $(call rel_path,$(JULIAHOME)/base,$(build_datarootdir))/ # <-- make sure this always has a trailing slash $(build_private_libdir)/basecompiler.ji: $(COMPILER_SRCS) @$(call PRINT_JULIA, cd $(JULIAHOME)/base && \ $(call spawn,$(JULIA_EXECUTABLE)) -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp \ - --startup-file=no --warn-overwrite=yes -g$(BOOTSTRAP_DEBUG_LEVEL) -O1 Base_compiler.jl $(RELBUILDROOT)) + --startup-file=no --warn-overwrite=yes -g$(BOOTSTRAP_DEBUG_LEVEL) -O1 Base_compiler.jl --buildroot $(RELBUILDROOT) --dataroot $(RELDATADIR)) @mv $@.tmp $@ $(build_private_libdir)/sys.ji: $(build_private_libdir)/basecompiler.ji $(JULIAHOME)/VERSION $(BASE_SRCS) $(STDLIB_SRCS) @$(call PRINT_JULIA, cd $(JULIAHOME)/base && \ if ! JULIA_BINDIR=$(call cygpath_w,$(build_bindir)) WINEPATH="$(call cygpath_w,$(build_bindir));$$WINEPATH" \ $(call spawn, $(JULIA_EXECUTABLE)) -g1 -O1 -C "$(JULIA_CPU_TARGET)" $(HEAPLIM) --output-ji $(call cygpath_w,$@).tmp $(JULIA_SYSIMG_BUILD_FLAGS) \ - --startup-file=no --warn-overwrite=yes --sysimage $(call cygpath_w,$<) sysimg.jl $(RELBUILDROOT); then \ + --startup-file=no --warn-overwrite=yes --sysimage $(call cygpath_w,$<) sysimg.jl --buildroot $(RELBUILDROOT) --dataroot $(RELDATADIR); then \ echo '*** This error might be fixed by running `make clean`. If the error persists$(COMMA) try `make cleanall`. ***'; \ false; \ fi )