SCons: Refactor handling of production flag and per-platform LTO defaults
Fixup to #63288. See #65583 for the bug report. Co-authored-by: Cyberrebell <chainsaw75@web.de>
This commit is contained in:
@ -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"),
|
||||
]
|
||||
|
||||
|
||||
@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user