stage2: don't build libunwind on OS's that don't need it
parent
f4dde4d109
commit
b183b612c9
|
@ -1883,7 +1883,8 @@ fn wantBuildLibUnwindFromSource(comp: *Compilation) bool {
|
|||
.Exe => true,
|
||||
};
|
||||
return comp.bin_file.options.link_libc and is_exe_or_dyn_lib and
|
||||
comp.bin_file.options.libc_installation == null;
|
||||
comp.bin_file.options.libc_installation == null and
|
||||
target_util.libcNeedsLibUnwind(comp.getTarget());
|
||||
}
|
||||
|
||||
fn updateBuiltinZigFile(comp: *Compilation, mod: *Module) !void {
|
||||
|
|
|
@ -128,6 +128,20 @@ pub fn osRequiresLibC(target: std.Target) bool {
|
|||
};
|
||||
}
|
||||
|
||||
pub fn libcNeedsLibUnwind(target: std.Target) bool {
|
||||
return switch (target.os.tag) {
|
||||
.windows,
|
||||
.macosx,
|
||||
.ios,
|
||||
.watchos,
|
||||
.tvos,
|
||||
.freestanding,
|
||||
=> false,
|
||||
|
||||
else => true,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn requiresPIE(target: std.Target) bool {
|
||||
return target.isAndroid();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue