diff options
Diffstat (limited to 'src/Package/Module.zig')
| -rw-r--r-- | src/Package/Module.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Package/Module.zig b/src/Package/Module.zig index 0a3d754e7a..0e777145d9 100644 --- a/src/Package/Module.zig +++ b/src/Package/Module.zig @@ -31,6 +31,7 @@ unwind_tables: bool, cc_argv: []const []const u8, /// (SPIR-V) whether to generate a structured control flow graph or not structured_cfg: bool, +no_builtin: bool, /// If the module is an `@import("builtin")` module, this is the `File` that /// is preallocated for it. Otherwise this field is null. @@ -95,6 +96,7 @@ pub const CreateOptions = struct { sanitize_thread: ?bool = null, fuzz: ?bool = null, structured_cfg: ?bool = null, + no_builtin: ?bool = null, }; }; @@ -298,6 +300,13 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { }; }; + const no_builtin = b: { + if (options.inherited.no_builtin) |x| break :b x; + if (options.parent) |p| break :b p.no_builtin; + + break :b target.cpu.arch.isBpf(); + }; + const llvm_cpu_features: ?[*:0]const u8 = b: { if (resolved_target.llvm_cpu_features) |x| break :b x; if (!options.global.use_llvm) break :b null; @@ -350,6 +359,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { .unwind_tables = unwind_tables, .cc_argv = options.cc_argv, .structured_cfg = structured_cfg, + .no_builtin = no_builtin, .builtin_file = null, }; @@ -442,6 +452,7 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { .unwind_tables = unwind_tables, .cc_argv = &.{}, .structured_cfg = structured_cfg, + .no_builtin = no_builtin, .builtin_file = new_file, }; new_file.* = .{ @@ -502,6 +513,7 @@ pub fn createLimited(gpa: Allocator, options: LimitedOptions) Allocator.Error!*P .unwind_tables = undefined, .cc_argv = undefined, .structured_cfg = undefined, + .no_builtin = undefined, .builtin_file = null, }; return mod; |
