diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-18 16:47:30 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-18 16:47:30 -0500 |
| commit | 28bf768883d2411d4cd75582d396d465ab6a54b2 (patch) | |
| tree | 542fb1bed1e22462938a62b5caf647c366dfc0c2 /src/link.cpp | |
| parent | 74a335c4ccd9eb4cfcc5cc6c01b633584c6bb6ba (diff) | |
| download | zig-28bf768883d2411d4cd75582d396d465ab6a54b2.tar.gz zig-28bf768883d2411d4cd75582d396d465ab6a54b2.zip | |
export _mh_execute_header with weak linkage
* also fix extern variables with initialiaztion values to generate runtime code
* remove the workaround in example/shared_library/mathtest.zig
* introduce the ability for global variables to have Weak and LinkOnce
linkage
* fix `@export` to work for non-functions. this code needs to be
audited though.
* fix comptime ptrcast not keeping bigger alignment
* fix linker warnings when targeting darwin
closes #1903
Diffstat (limited to 'src/link.cpp')
| -rw-r--r-- | src/link.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/link.cpp b/src/link.cpp index 956e5b6bfc..f6f0c0ffcd 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -899,7 +899,11 @@ static void construct_linker_job_macho(LinkJob *lj) { lj->args.append("-ios_simulator_version_min"); break; } - lj->args.append(buf_ptr(buf_sprintf("%d.%d.%d", platform.major, platform.minor, platform.micro))); + Buf *version_string = buf_sprintf("%d.%d.%d", platform.major, platform.minor, platform.micro); + lj->args.append(buf_ptr(version_string)); + + lj->args.append("-sdk_version"); + lj->args.append(buf_ptr(version_string)); if (g->out_type == OutTypeExe) { @@ -920,7 +924,9 @@ static void construct_linker_job_macho(LinkJob *lj) { add_rpath(lj, &g->output_file_path); if (shared) { - lj->args.append("-headerpad_max_install_names"); + if (g->system_linker_hack) { + lj->args.append("-headerpad_max_install_names"); + } } else if (g->is_static) { lj->args.append("-lcrt0.o"); } else { |
