-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22530 from alexrp/omit-unwind-tables
Fix building the standard library without CFI directives
- Loading branch information
Showing
18 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const std = @import("std"); | ||
|
||
pub fn build(b: *std.Build) void { | ||
inline for (.{ | ||
.aarch64, | ||
.aarch64_be, | ||
.hexagon, | ||
.loongarch64, | ||
.mips, | ||
.mipsel, | ||
.mips64, | ||
.mips64el, | ||
.powerpc, | ||
.powerpcle, | ||
.powerpc64, | ||
.powerpc64le, | ||
.riscv32, | ||
.riscv64, | ||
.s390x, | ||
.sparc64, | ||
.x86, | ||
.x86_64, | ||
}) |arch| { | ||
const target = b.resolveTargetQuery(.{ | ||
.cpu_arch = arch, | ||
.os_tag = .linux, | ||
}); | ||
|
||
const omit_dbg = b.addExecutable(.{ | ||
.name = b.fmt("{s}-linux-omit-dbg", .{@tagName(arch)}), | ||
.root_module = b.createModule(.{ | ||
.root_source_file = b.path("main.zig"), | ||
.target = target, | ||
.optimize = .Debug, | ||
// We are mainly concerned with CFI directives in our non-libc startup code and syscall | ||
// code, so make it explicit that we don't want libc. | ||
.link_libc = false, | ||
.strip = true, | ||
}), | ||
}); | ||
|
||
const omit_uwt = b.addExecutable(.{ | ||
.name = b.fmt("{s}-linux-omit-uwt", .{@tagName(arch)}), | ||
.root_module = b.createModule(.{ | ||
.root_source_file = b.path("main.zig"), | ||
.target = target, | ||
.optimize = .Debug, | ||
.link_libc = false, | ||
.unwind_tables = .none, | ||
}), | ||
}); | ||
|
||
const omit_both = b.addExecutable(.{ | ||
.name = b.fmt("{s}-linux-omit-both", .{@tagName(arch)}), | ||
.root_module = b.createModule(.{ | ||
.root_source_file = b.path("main.zig"), | ||
.target = target, | ||
.optimize = .Debug, | ||
.link_libc = false, | ||
.strip = true, | ||
.unwind_tables = .none, | ||
}), | ||
}); | ||
|
||
inline for (.{ omit_dbg, omit_uwt, omit_both }) |step| b.installArtifact(step); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub fn main() void {} |