mirror of
https://github.com/ziglang/zig.git
synced 2025-12-18 12:13:20 +00:00
correct bug with omit frame pointer logic
This commit is contained in:
parent
83dcfd6205
commit
f951bf8aeb
@ -3386,12 +3386,6 @@ pub fn addCCArgs(
|
||||
try argv.append("-mthumb");
|
||||
}
|
||||
|
||||
if (comp.haveFramePointer()) {
|
||||
try argv.append("-fno-omit-frame-pointer");
|
||||
} else {
|
||||
try argv.append("-fomit-frame-pointer");
|
||||
}
|
||||
|
||||
if (comp.sanitize_c and !comp.bin_file.options.tsan) {
|
||||
try argv.append("-fsanitize=undefined");
|
||||
try argv.append("-fsanitize-trap=undefined");
|
||||
@ -3711,16 +3705,6 @@ test "classifyFileExt" {
|
||||
try std.testing.expectEqual(FileExt.zig, classifyFileExt("foo.zig"));
|
||||
}
|
||||
|
||||
fn haveFramePointer(comp: *const Compilation) bool {
|
||||
// If you complicate this logic make sure you update the parent cache hash.
|
||||
// Right now it's not in the cache hash because the value depends on optimize_mode
|
||||
// and strip which are both already part of the hash.
|
||||
return switch (comp.bin_file.options.optimize_mode) {
|
||||
.Debug, .ReleaseSafe => !comp.bin_file.options.strip,
|
||||
.ReleaseSmall, .ReleaseFast => false,
|
||||
};
|
||||
}
|
||||
|
||||
const LibCDirs = struct {
|
||||
libc_include_dir_list: []const []const u8,
|
||||
libc_installation: ?*const LibCInstallation,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user