diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-01-07 16:02:58 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-01-07 16:02:58 -0500 |
| commit | e2e9be5deac75e102bc5faaa94aa17308224f9f6 (patch) | |
| tree | ed6c69e1735acc2ee9615b86a9a12fb25b192eb4 /src-self-hosted | |
| parent | 437c6a4b7ef115208ae84a938f989b92fb282c39 (diff) | |
| parent | af390b75dbdb33f6ccf80c14d32ee5b89421c35b (diff) | |
| download | zig-e2e9be5deac75e102bc5faaa94aa17308224f9f6.tar.gz zig-e2e9be5deac75e102bc5faaa94aa17308224f9f6.zip | |
Merge branch 'dcao-master'
closes #3981
Diffstat (limited to 'src-self-hosted')
| -rw-r--r-- | src-self-hosted/compilation.zig | 2 | ||||
| -rw-r--r-- | src-self-hosted/link.zig | 3 | ||||
| -rw-r--r-- | src-self-hosted/main.zig | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src-self-hosted/compilation.zig b/src-self-hosted/compilation.zig index a7ba07342e..0f455fadcd 100644 --- a/src-self-hosted/compilation.zig +++ b/src-self-hosted/compilation.zig @@ -170,6 +170,8 @@ pub const Compilation = struct { verbose_llvm_ir: bool = false, verbose_link: bool = false, + link_eh_frame_hdr: bool = false, + darwin_version_min: DarwinVersionMin = .None, test_filters: []const []const u8 = &[_][]const u8{}, diff --git a/src-self-hosted/link.zig b/src-self-hosted/link.zig index afe4d10c65..efb83710d9 100644 --- a/src-self-hosted/link.zig +++ b/src-self-hosted/link.zig @@ -144,6 +144,9 @@ fn constructLinkerArgsElf(ctx: *Context) !void { // lj->args.append(g->linker_script); //} try ctx.args.append("--gc-sections"); + if (ctx.comp.link_eh_frame_hdr) { + try ctx.args.append("--eh-frame-hdr"); + } //lj->args.append("-m"); //lj->args.append(getLDMOption(&g->zig_target)); diff --git a/src-self-hosted/main.zig b/src-self-hosted/main.zig index 5224375e46..a19743bd71 100644 --- a/src-self-hosted/main.zig +++ b/src-self-hosted/main.zig @@ -154,6 +154,7 @@ const usage_build_generic = \\ --static Output will be statically linked \\ --strip Exclude debug symbols \\ -target [name] <arch><sub>-<os>-<abi> see the targets command + \\ --eh-frame-hdr enable C++ exception handling by passing --eh-frame-hdr to linker \\ --verbose-tokenize Turn on compiler debug output for tokenization \\ --verbose-ast-tree Turn on compiler debug output for parsing into an AST (tree view) \\ --verbose-ast-fmt Turn on compiler debug output for parsing into an AST (render source) @@ -207,6 +208,7 @@ fn buildOutputType(allocator: *Allocator, args: []const []const u8, out_type: Co var verbose_llvm_ir = false; var verbose_cimport = false; var linker_rdynamic = false; + var link_eh_frame_hdr = false; var macosx_version_min: ?[]const u8 = null; var ios_version_min: ?[]const u8 = null; @@ -369,6 +371,8 @@ fn buildOutputType(allocator: *Allocator, args: []const []const u8, out_type: Co verbose_ir = true; } else if (mem.eql(u8, arg, "--verbose-llvm-ir")) { verbose_llvm_ir = true; + } else if (mem.eql(u8, arg, "--eh-frame-hdr")) { + link_eh_frame_hdr = true; } else if (mem.eql(u8, arg, "--verbose-cimport")) { verbose_cimport = true; } else if (mem.eql(u8, arg, "-rdynamic")) { @@ -498,6 +502,8 @@ fn buildOutputType(allocator: *Allocator, args: []const []const u8, out_type: Co comp.verbose_llvm_ir = verbose_llvm_ir; comp.verbose_cimport = verbose_cimport; + comp.link_eh_frame_hdr = link_eh_frame_hdr; + comp.err_color = color; comp.linker_rdynamic = linker_rdynamic; |
