From 8be8577da6f76de4e6c93cae596f1dfeee3903e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 23 Sep 2022 13:55:00 +0200 Subject: [PATCH] SCons: Remove redundant `-fomit-frame-pointer` and `-ftree-vectorize` - `-fomit-frame-pointer` is included automatically by both GCC and Clang in `-O1` and above. - `-ftree-vectorize` is included automatically by GCC in `-O2` and beyond, and seems always enabled by Clang. Closes #66296. See that issue for a detailed investigation. (cherry picked from commit c5c3d13dc0dbbf95a2350f57d69e7cdc546d395d) --- platform/android/detect.py | 3 +-- platform/iphone/detect.py | 4 ++-- platform/osx/detect.py | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/platform/android/detect.py b/platform/android/detect.py index 36dd4b2c0..23b0b8b69 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -117,12 +117,11 @@ def configure(env): # `-O2` is more friendly to debuggers than `-O3`, leading to better crash backtraces # when using `target=release_debug`. opt = "-O3" if env["target"] == "release" else "-O2" - env.Append(CCFLAGS=[opt, "-fomit-frame-pointer"]) + env.Append(CCFLAGS=[opt]) elif env["optimize"] == "size": # optimize for size env.Append(CCFLAGS=["-Oz"]) env.Append(CPPDEFINES=["NDEBUG"]) - env.Append(CCFLAGS=["-ftree-vectorize"]) elif env["target"] == "debug": env.Append(LINKFLAGS=["-O0"]) env.Append(CCFLAGS=["-O0", "-g", "-fno-limit-debug-info"]) diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 4652f4772..2b81fe5cb 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -54,10 +54,10 @@ def configure(env): # `-O2` is more friendly to debuggers than `-O3`, leading to better crash backtraces # when using `target=release_debug`. opt = "-O3" if env["target"] == "release" else "-O2" - env.Append(CCFLAGS=[opt, "-ftree-vectorize", "-fomit-frame-pointer"]) + env.Append(CCFLAGS=[opt]) env.Append(LINKFLAGS=[opt]) elif env["optimize"] == "size": # optimize for size - env.Append(CCFLAGS=["-Os", "-ftree-vectorize"]) + env.Append(CCFLAGS=["-Os"]) env.Append(LINKFLAGS=["-Os"]) elif env["target"] == "debug": diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 89662e23f..5a3517ef3 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -43,9 +43,9 @@ def configure(env): if env["target"] == "release": if env["optimize"] == "speed": # optimize for speed (default) - env.Prepend(CCFLAGS=["-O3", "-fomit-frame-pointer", "-ftree-vectorize"]) + env.Prepend(CCFLAGS=["-O3"]) elif env["optimize"] == "size": # optimize for size - env.Prepend(CCFLAGS=["-Os", "-ftree-vectorize"]) + env.Prepend(CCFLAGS=["-Os"]) if env["arch"] != "arm64": env.Prepend(CCFLAGS=["-msse2"])