authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-01-08 01:33:34+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-01-08 01:33:34+02:00
log5031519b737e9b8338f1091b5b6f4c059dfb5c2c
treedd715139c6b35e1731038cbd1d4c515c1434966e
parent804cee3b93cb7084c16ee61d3bcb57f7d3c9f0bc
parent22598ef35f3e39444c1406927532e76f42f01324
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #18362 from ExpidusOS/fix/compiler-rt-codemodel

Compilation: pass code model to buildOutputFromZig

2 files changed, 9 insertions(+), 0 deletions(-)

lib/std/Build.zig+8
......@@ -608,6 +608,7 @@ pub const ExecutableOptions = struct {
608608 root_source_file: ?LazyPath = null,
609609 version: ?std.SemanticVersion = null,
610610 optimize: std.builtin.OptimizeMode = .Debug,
611 code_model: std.builtin.CodeModel = .default,
611612 linkage: ?Step.Compile.Linkage = null,
612613 max_rss: usize = 0,
613614 link_libc: ?bool = null,
......@@ -644,6 +645,7 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
644645 .omit_frame_pointer = options.omit_frame_pointer,
645646 .sanitize_thread = options.sanitize_thread,
646647 .error_tracing = options.error_tracing,
648 .code_model = options.code_model,
647649 },
648650 .version = options.version,
649651 .kind = .exe,
......@@ -662,6 +664,7 @@ pub const ObjectOptions = struct {
662664 /// To choose the same computer as the one building the package, pass the
663665 /// `host` field of the package's `Build` instance.
664666 target: ResolvedTarget,
667 code_model: std.builtin.CodeModel = .default,
665668 optimize: std.builtin.OptimizeMode,
666669 max_rss: usize = 0,
667670 link_libc: ?bool = null,
......@@ -692,6 +695,7 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
692695 .omit_frame_pointer = options.omit_frame_pointer,
693696 .sanitize_thread = options.sanitize_thread,
694697 .error_tracing = options.error_tracing,
698 .code_model = options.code_model,
695699 },
696700 .kind = .obj,
697701 .max_rss = options.max_rss,
......@@ -707,6 +711,7 @@ pub const SharedLibraryOptions = struct {
707711 /// `host` field of the package's `Build` instance.
708712 target: ResolvedTarget,
709713 optimize: std.builtin.OptimizeMode,
714 code_model: std.builtin.CodeModel = .default,
710715 root_source_file: ?LazyPath = null,
711716 version: ?std.SemanticVersion = null,
712717 max_rss: usize = 0,
......@@ -744,6 +749,7 @@ pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile
744749 .omit_frame_pointer = options.omit_frame_pointer,
745750 .sanitize_thread = options.sanitize_thread,
746751 .error_tracing = options.error_tracing,
752 .code_model = options.code_model,
747753 },
748754 .kind = .lib,
749755 .linkage = .dynamic,
......@@ -763,6 +769,7 @@ pub const StaticLibraryOptions = struct {
763769 /// `host` field of the package's `Build` instance.
764770 target: ResolvedTarget,
765771 optimize: std.builtin.OptimizeMode,
772 code_model: std.builtin.CodeModel = .default,
766773 version: ?std.SemanticVersion = null,
767774 max_rss: usize = 0,
768775 link_libc: ?bool = null,
......@@ -793,6 +800,7 @@ pub fn addStaticLibrary(b: *Build, options: StaticLibraryOptions) *Step.Compile
793800 .omit_frame_pointer = options.omit_frame_pointer,
794801 .sanitize_thread = options.sanitize_thread,
795802 .error_tracing = options.error_tracing,
803 .code_model = options.code_model,
796804 },
797805 .kind = .lib,
798806 .linkage = .static,
src/Compilation.zig+1
......@@ -6334,6 +6334,7 @@ fn buildOutputFromZig(
63346334 .pic = comp.root_mod.pic,
63356335 .optimize_mode = optimize_mode,
63366336 .structured_cfg = comp.root_mod.structured_cfg,
6337 .code_model = comp.root_mod.code_model,
63376338 },
63386339 .global = config,
63396340 .cc_argv = &.{},