Skip to content

Commit

Permalink
Do not run precompilation for sys0.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed May 20, 2015
1 parent 8a1508d commit a7c9e07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions base/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

ccall(:jl_, Void, (Any,), "Precompiling")
ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_current_module, Ptr{Void})))
ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_base_module, Ptr{Void})))

# prime method cache with some things we know we'll need right after startup
precompile(!=, (Bool, Bool))
precompile(!=, (SubString{ASCIIString}, ASCIIString))
Expand Down
14 changes: 13 additions & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ importall .Base64
include("io.jl")
include("iostream.jl")

const _is_sys0 = (JLOptions().image_file == C_NULL &&
(JLOptions().build_path != C_NULL &&
endswith(bytestring(JLOptions().build_path), "sys0")))

ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_current_module, Ptr{Void})))
ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_base_module, Ptr{Void})))

# system & environment
include("libc.jl")
using .Libc: getpid, gethostname, time, msync
Expand Down Expand Up @@ -313,7 +320,12 @@ function __init__()
init_parallel()
end

include("precompile.jl")
if !_is_sys0
ccall(:jl_, Void, (Any,), "Loading precompile.jl")
ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_current_module, Ptr{Void})))
ccall(:jl_, Void, (Any,), unsafe_load(cglobal(:jl_base_module, Ptr{Void})))
include("precompile.jl")
end

include = include_from_node1

Expand Down

0 comments on commit a7c9e07

Please sign in to comment.