diff --git a/src/static_julia.jl b/src/static_julia.jl index aa60e042..6785458a 100644 --- a/src/static_julia.jl +++ b/src/static_julia.jl @@ -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 @@ -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() diff --git a/src/system_image.jl b/src/system_image.jl index 3ea540a5..36ae4f81 100644 --- a/src/system_image.jl +++ b/src/system_image.jl @@ -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