summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-16 09:00:24 +0200
committerGitHub <noreply@github.com>2021-04-16 09:00:24 +0200
commitdcc82a3f412f31321b03491736df34a4124a5f89 (patch)
tree24eb29245e305a9bad5a2d2f288a7a7f0c0f953d
parentc022582c1ebca6d3d8b53f60e83f99ceb451307b (diff)
parenta79cc0d7729e1c594a586d79abd06fa19677e733 (diff)
Merge pull request #47939 from bruvzg/macos_sanitizer
Fix macOS build with all sanitizers enabled.
-rw-r--r--platform/linuxbsd/detect.py2
-rw-r--r--platform/osx/detect.py16
-rw-r--r--platform/server/detect.py2
3 files changed, 4 insertions, 16 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index ebcb4c2a80..646ae4d457 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -156,7 +156,7 @@ def configure(env):
if env["use_llvm"]:
env.Append(
CCFLAGS=[
- "-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change,implicit-signed-integer-truncation,implicit-unsigned-integer-truncation"
+ "-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change"
]
)
else:
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index afdafe75e5..317e79d0ea 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -35,7 +35,6 @@ def get_opts():
BoolVariable("separate_debug_symbols", "Create a separate file containing debugging symbols", False),
BoolVariable("use_ubsan", "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)", False),
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN)", False),
- BoolVariable("use_lsan", "Use LLVM/GCC compiler leak sanitizer (LSAN)", False),
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),
]
@@ -132,7 +131,7 @@ def configure(env):
env["AS"] = basecmd + "as"
env.Append(CPPDEFINES=["__MACPORTS__"]) # hack to fix libvpx MM256_BROADCASTSI128_SI256 define
- if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"]:
+ if env["use_ubsan"] or env["use_asan"] or env["use_tsan"]:
env.extra_suffix += "s"
if env["use_ubsan"]:
@@ -142,23 +141,12 @@ def configure(env):
]
)
env.Append(LINKFLAGS=["-fsanitize=undefined"])
- if env["use_llvm"]:
- env.Append(
- CCFLAGS=[
- "-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change,implicit-signed-integer-truncation,implicit-unsigned-integer-truncation"
- ]
- )
- else:
- env.Append(CCFLAGS=["-fsanitize=bounds-strict"])
+ env.Append(CCFLAGS=["-fsanitize=nullability-return,nullability-arg,function,nullability-assign"])
if env["use_asan"]:
env.Append(CCFLAGS=["-fsanitize=address,pointer-subtract,pointer-compare"])
env.Append(LINKFLAGS=["-fsanitize=address"])
- if env["use_lsan"]:
- env.Append(CCFLAGS=["-fsanitize=leak"])
- env.Append(LINKFLAGS=["-fsanitize=leak"])
-
if env["use_tsan"]:
env.Append(CCFLAGS=["-fsanitize=thread"])
env.Append(LINKFLAGS=["-fsanitize=thread"])
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 4a4109db4a..478bcad212 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -113,7 +113,7 @@ def configure(env):
if env["use_llvm"]:
env.Append(
CCFLAGS=[
- "-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change,implicit-signed-integer-truncation,implicit-unsigned-integer-truncation"
+ "-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change"
]
)
else: