Skip to content
Open
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 docs/src/devdocs/sysimages_part_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,10 @@ julia> stat(unsafe_string(Base.JLOptions().image_file)).size / (1024*1024)
##### macOS

On `macOS` the linker flag `-Wl,--whole-archive` is instead written as
`-Wl,-all_load` so the command would be
`-Wl,-force_load` for each object file, so the command would be

```
gcc -shared -o sys.dylib -Wl,-all_load sys.o -L"/home/kc/Applications/julia-1.3.0-rc4/lib" -ljulia
gcc -shared -o sys.dylib -Wl,-force_load,sys.o -L"/home/kc/Applications/julia-1.3.0-rc4/lib" -ljulia
```

Note that the extension has been changed from `so` to `dylib` which is the
Expand Down
2 changes: 1 addition & 1 deletion src/PackageCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ function create_sysimg_from_object_file(object_files::Vector{String},
end
mkpath(dirname(sysimage_path))
# Prevent compiler from stripping all symbols from the shared lib.
o_file_flags = Sys.isapple() ? `-Wl,-all_load $object_files` : `-Wl,--whole-archive $object_files -Wl,--no-whole-archive`
o_file_flags = Sys.isapple() ? `$(map(f -> "-Wl,-force_load,$f", object_files)...)` : `-Wl,--whole-archive $object_files -Wl,--no-whole-archive`
extra = get_extra_linker_flags(version, compat_level, soname)
cmd = `$(bitflag()) $(march()) -shared -L$(julia_libdir()) -L$(julia_private_libdir()) -o $sysimage_path $o_file_flags $(Base.shell_split(ldlibs())) $extra`
run_compiler(cmd; cplusplus=true)
Expand Down
Loading