mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
fix libc++ exceptions for musl targets
This reverts commit d31be31267523cadd6d59b52633f2d4a9758a3b4. The problem was happening due to an LLVM bug exposed by having LTO enabled for libunwind. The simple workaround is to disable LTO for libunwind. It can be re-enabled in the future when the upstream bug is fixed. See #12828
This commit is contained in:
parent
cdb40936bd
commit
f9859c102d
@ -109,7 +109,8 @@ pub fn buildStaticLib(comp: *Compilation) !void {
|
|||||||
.want_tsan = false,
|
.want_tsan = false,
|
||||||
.want_pic = comp.bin_file.options.pic,
|
.want_pic = comp.bin_file.options.pic,
|
||||||
.want_pie = comp.bin_file.options.pie,
|
.want_pie = comp.bin_file.options.pie,
|
||||||
.want_lto = comp.bin_file.options.lto,
|
// Disable LTO to avoid https://github.com/llvm/llvm-project/issues/56825
|
||||||
|
.want_lto = false,
|
||||||
.function_sections = comp.bin_file.options.function_sections,
|
.function_sections = comp.bin_file.options.function_sections,
|
||||||
.emit_h = null,
|
.emit_h = null,
|
||||||
.strip = comp.compilerRtStrip(),
|
.strip = comp.compilerRtStrip(),
|
||||||
|
|||||||
@ -12,15 +12,9 @@ fn isRunnableTarget(t: CrossTarget) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn build(b: *Builder) void {
|
pub fn build(b: *Builder) void {
|
||||||
var mode = b.standardReleaseOptions();
|
const mode = b.standardReleaseOptions();
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
|
|
||||||
if (mode != .Debug and target.getAbi().isMusl()) {
|
|
||||||
// https://github.com/ziglang/zig/issues/12828
|
|
||||||
std.debug.print("warn: skipping musl libc++ test that regressed with LLVM 15\n", .{});
|
|
||||||
mode = .Debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
const test_step = b.step("test", "Test the program");
|
const test_step = b.step("test", "Test the program");
|
||||||
|
|
||||||
const exe_c = b.addExecutable("test_c", null);
|
const exe_c = b.addExecutable("test_c", null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user