summaryrefslogtreecommitdiff
path: root/platform/macos/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/detect.py')
-rw-r--r--platform/macos/detect.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index bcf4776609..58d9c0e99f 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -40,9 +40,6 @@ def get_flags():
return [
("arch", detect_arch()),
("use_volk", False),
- # Benefits of LTO for macOS (size, performance) haven't been clearly established yet.
- # So for now we override the default value which may be set when using `production=yes`.
- ("lto", "none"),
]
@@ -91,9 +88,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"])
@@ -170,6 +167,10 @@ def configure(env):
env["AS"] = basecmd + "as"
# LTO
+
+ if env["lto"] == "auto": # LTO benefits for macOS (size, performance) haven't been clearly established yet.
+ env["lto"] = "none"
+
if env["lto"] != "none":
if env["lto"] == "thin":
env.Append(CCFLAGS=["-flto=thin"])
@@ -178,6 +179,8 @@ def configure(env):
env.Append(CCFLAGS=["-flto"])
env.Append(LINKFLAGS=["-flto"])
+ # Sanitizers
+
if env["use_ubsan"] or env["use_asan"] or env["use_tsan"]:
env.extra_suffix += ".san"
env.Append(CCFLAGS=["-DSANITIZERS_ENABLED"])