authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-27 00:37:18-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-27 17:07:56-08:00
log37037b269e4484702d12a3c8c909d4b8ed5895f1
tree3aeb088d4cd8124d3ff7b9d4111515a619b80c16
parent884b1423a4e33323b28d97b7458bade9a36acce9

frontend: use main Compilation code_model when building libxx

as well as libtsan, libunwind, and libc files

4 files changed, 5 insertions(+), 0 deletions(-)

src/Compilation.zig+1
......@@ -6611,6 +6611,7 @@ pub fn build_crt_file(
66116611 .structured_cfg = comp.root_mod.structured_cfg,
66126612 // Some libcs (e.g. musl) are opinionated about -fno-builtin.
66136613 .no_builtin = options.no_builtin orelse comp.root_mod.no_builtin,
6614 .code_model = comp.root_mod.code_model,
66146615 },
66156616 .global = config,
66166617 .cc_argv = &.{},
src/libcxx.zig+2
......@@ -196,6 +196,7 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
196196 .optimize_mode = optimize_mode,
197197 .structured_cfg = comp.root_mod.structured_cfg,
198198 .pic = if (target_util.supports_fpic(target)) true else null,
199 .code_model = comp.root_mod.code_model,
199200 },
200201 .global = config,
201202 .cc_argv = &.{},
......@@ -445,6 +446,7 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
445446 .structured_cfg = comp.root_mod.structured_cfg,
446447 .unwind_tables = unwind_tables,
447448 .pic = comp.root_mod.pic,
449 .code_model = comp.root_mod.code_model,
448450 },
449451 .global = config,
450452 .cc_argv = &.{},
src/libtsan.zig+1
......@@ -105,6 +105,7 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
105105 .structured_cfg = comp.root_mod.structured_cfg,
106106 .pic = true,
107107 .no_builtin = true,
108 .code_model = comp.root_mod.code_model,
108109 },
109110 .global = config,
110111 .cc_argv = &common_flags,
src/libunwind.zig+1
......@@ -71,6 +71,7 @@ pub fn buildStaticLib(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
7171 .unwind_tables = unwind_tables,
7272 .pic = if (target_util.supports_fpic(target)) true else null,
7373 .optimize_mode = comp.compilerRtOptMode(),
74 .code_model = comp.root_mod.code_model,
7475 },
7576 .global = config,
7677 .cc_argv = &.{},