Commit f951bf8aeb

Lee Cannon <leecannon@leecannon.xyz>
2021-11-01 18:57:04
correct bug with omit frame pointer logic
1 parent 83dcfd6
Changed files (1)
src/Compilation.zig
@@ -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,