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 {...@@ -608,6 +608,7 @@ pub const ExecutableOptions = struct {
608 root_source_file: ?LazyPath = null,608 root_source_file: ?LazyPath = null,
609 version: ?std.SemanticVersion = null,609 version: ?std.SemanticVersion = null,
610 optimize: std.builtin.OptimizeMode = .Debug,610 optimize: std.builtin.OptimizeMode = .Debug,
611 code_model: std.builtin.CodeModel = .default,
611 linkage: ?Step.Compile.Linkage = null,612 linkage: ?Step.Compile.Linkage = null,
612 max_rss: usize = 0,613 max_rss: usize = 0,
613 link_libc: ?bool = null,614 link_libc: ?bool = null,
...@@ -644,6 +645,7 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {...@@ -644,6 +645,7 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
644 .omit_frame_pointer = options.omit_frame_pointer,645 .omit_frame_pointer = options.omit_frame_pointer,
645 .sanitize_thread = options.sanitize_thread,646 .sanitize_thread = options.sanitize_thread,
646 .error_tracing = options.error_tracing,647 .error_tracing = options.error_tracing,
648 .code_model = options.code_model,
647 },649 },
648 .version = options.version,650 .version = options.version,
649 .kind = .exe,651 .kind = .exe,
...@@ -662,6 +664,7 @@ pub const ObjectOptions = struct {...@@ -662,6 +664,7 @@ pub const ObjectOptions = struct {
662 /// To choose the same computer as the one building the package, pass the664 /// To choose the same computer as the one building the package, pass the
663 /// `host` field of the package's `Build` instance.665 /// `host` field of the package's `Build` instance.
664 target: ResolvedTarget,666 target: ResolvedTarget,
667 code_model: std.builtin.CodeModel = .default,
665 optimize: std.builtin.OptimizeMode,668 optimize: std.builtin.OptimizeMode,
666 max_rss: usize = 0,669 max_rss: usize = 0,
667 link_libc: ?bool = null,670 link_libc: ?bool = null,
...@@ -692,6 +695,7 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {...@@ -692,6 +695,7 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
692 .omit_frame_pointer = options.omit_frame_pointer,695 .omit_frame_pointer = options.omit_frame_pointer,
693 .sanitize_thread = options.sanitize_thread,696 .sanitize_thread = options.sanitize_thread,
694 .error_tracing = options.error_tracing,697 .error_tracing = options.error_tracing,
698 .code_model = options.code_model,
695 },699 },
696 .kind = .obj,700 .kind = .obj,
697 .max_rss = options.max_rss,701 .max_rss = options.max_rss,
...@@ -707,6 +711,7 @@ pub const SharedLibraryOptions = struct {...@@ -707,6 +711,7 @@ pub const SharedLibraryOptions = struct {
707 /// `host` field of the package's `Build` instance.711 /// `host` field of the package's `Build` instance.
708 target: ResolvedTarget,712 target: ResolvedTarget,
709 optimize: std.builtin.OptimizeMode,713 optimize: std.builtin.OptimizeMode,
714 code_model: std.builtin.CodeModel = .default,
710 root_source_file: ?LazyPath = null,715 root_source_file: ?LazyPath = null,
711 version: ?std.SemanticVersion = null,716 version: ?std.SemanticVersion = null,
712 max_rss: usize = 0,717 max_rss: usize = 0,
...@@ -744,6 +749,7 @@ pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile...@@ -744,6 +749,7 @@ pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile
744 .omit_frame_pointer = options.omit_frame_pointer,749 .omit_frame_pointer = options.omit_frame_pointer,
745 .sanitize_thread = options.sanitize_thread,750 .sanitize_thread = options.sanitize_thread,
746 .error_tracing = options.error_tracing,751 .error_tracing = options.error_tracing,
752 .code_model = options.code_model,
747 },753 },
748 .kind = .lib,754 .kind = .lib,
749 .linkage = .dynamic,755 .linkage = .dynamic,
...@@ -763,6 +769,7 @@ pub const StaticLibraryOptions = struct {...@@ -763,6 +769,7 @@ pub const StaticLibraryOptions = struct {
763 /// `host` field of the package's `Build` instance.769 /// `host` field of the package's `Build` instance.
764 target: ResolvedTarget,770 target: ResolvedTarget,
765 optimize: std.builtin.OptimizeMode,771 optimize: std.builtin.OptimizeMode,
772 code_model: std.builtin.CodeModel = .default,
766 version: ?std.SemanticVersion = null,773 version: ?std.SemanticVersion = null,
767 max_rss: usize = 0,774 max_rss: usize = 0,
768 link_libc: ?bool = null,775 link_libc: ?bool = null,
...@@ -793,6 +800,7 @@ pub fn addStaticLibrary(b: *Build, options: StaticLibraryOptions) *Step.Compile...@@ -793,6 +800,7 @@ pub fn addStaticLibrary(b: *Build, options: StaticLibraryOptions) *Step.Compile
793 .omit_frame_pointer = options.omit_frame_pointer,800 .omit_frame_pointer = options.omit_frame_pointer,
794 .sanitize_thread = options.sanitize_thread,801 .sanitize_thread = options.sanitize_thread,
795 .error_tracing = options.error_tracing,802 .error_tracing = options.error_tracing,
803 .code_model = options.code_model,
796 },804 },
797 .kind = .lib,805 .kind = .lib,
798 .linkage = .static,806 .linkage = .static,
src/Compilation.zig+1
...@@ -6334,6 +6334,7 @@ fn buildOutputFromZig(...@@ -6334,6 +6334,7 @@ fn buildOutputFromZig(
6334 .pic = comp.root_mod.pic,6334 .pic = comp.root_mod.pic,
6335 .optimize_mode = optimize_mode,6335 .optimize_mode = optimize_mode,
6336 .structured_cfg = comp.root_mod.structured_cfg,6336 .structured_cfg = comp.root_mod.structured_cfg,
6337 .code_model = comp.root_mod.code_model,
6337 },6338 },
6338 .global = config,6339 .global = config,
6339 .cc_argv = &.{},6340 .cc_argv = &.{},