Skip to content

Commit

Permalink
bugfix image compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr-Hlavenka committed Sep 20, 2018
1 parent 334e63c commit 98c4ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/static_julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ end

function build_shared(s_file, o_file, builddir, verbose, optimize, debug, cc, cc_flags, shared_init)
# Prevent compiler from stripping all symbols from the shared lib.
si_file = nothing
si_file = ""
if shared_init
si_file = joinpath(builddir, "lib_init.c")
open(si_file, "w") do io
Expand Down Expand Up @@ -293,7 +293,8 @@ function build_shared(s_file, o_file, builddir, verbose, optimize, debug, cc, cc
o_file = `-Wl,--whole-archive $o_file -Wl,--no-whole-archive`
end
end
command = `$cc -shared -DJULIAC_PROGRAM_LIBNAME=\"$s_file\" -o $s_file $o_file $si_file $(julia_flags(optimize, debug, cc_flags))`
command = shared_init ? `$cc -shared -DJULIAC_PROGRAM_LIBNAME=\"$s_file\" -o $s_file $o_file $si_file $(julia_flags(optimize, debug, cc_flags))` :
`$cc -shared -DJULIAC_PROGRAM_LIBNAME=\"$s_file\" -o $s_file $o_file $(julia_flags(optimize, debug, cc_flags))`
if isapple()
command = `$command -Wl,-install_name,@rpath/$s_file`
elseif iswindows()
Expand Down
2 changes: 1 addition & 1 deletion src/system_image.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function compile_system_image(sysimg_path, cpu_target = nothing; debug = false)

build_shared(
"$sysimg_path.$(Libdl.dlext)", "$sysimg_path.o", ".",
true, nothing, debug ? 2 : nothing, cc, nothing
true, nothing, debug ? 2 : nothing, cc, nothing, false
)
end
end
Expand Down

0 comments on commit 98c4ade

Please sign in to comment.