Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Compiler/src/Compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions base/Base_compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,29 +266,34 @@ 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
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

Expand Down
5 changes: 3 additions & 2 deletions sysimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] $@

$(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 )
Expand Down