Skip to content

Commit 9ff88b7

Browse files
committed
fix address sanitizer
Signed-off-by: Adin Cebic <cebic.ad@gmail.com>
1 parent dd84137 commit 9ff88b7

2 files changed

Lines changed: 4 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ END_UNRELEASED_TEMPLATE
5656

5757
### Fixed
5858

59-
* TBD
59+
* Fixed Address Sanitizer being incorrectly applied to host tools during the build, which cause those tools to fail to build.
6060

6161
### Ruleset Development Changes
6262

xcodeproj/internal/templates/generate_bazel_dependencies.sh

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,32 +147,13 @@ fi
147147
# Runtime Sanitizers
148148
if [[ $apply_sanitizers -eq 1 ]]; then
149149
if [ "${ENABLE_ADDRESS_SANITIZER:-}" == "YES" ]; then
150-
build_pre_config_flags+=(
151-
--copt=-fno-omit-frame-pointer
152-
--copt=-fno-sanitize-recover=all
153-
--copt=-fsanitize=address
154-
--linkopt=-fsanitize=address
155-
--%swiftcopt%=-sanitize=address
156-
--copt=-Wno-macro-redefined
157-
--copt=-D_FORTIFY_SOURCE=0
158-
)
150+
build_pre_config_flags+=(--features=asan --host_features=-asan)
159151
fi
160152
if [ "${ENABLE_THREAD_SANITIZER:-}" == "YES" ]; then
161-
build_pre_config_flags+=(
162-
--copt=-fno-omit-frame-pointer
163-
--copt=-fno-sanitize-recover=all
164-
--copt=-fsanitize=thread
165-
--linkopt=-fsanitize=thread
166-
--%swiftcopt%=-sanitize=thread
167-
)
153+
build_pre_config_flags+=(--features=tsan --host_features=-tsan)
168154
fi
169155
if [ "${ENABLE_UNDEFINED_BEHAVIOR_SANITIZER:-}" == "YES" ]; then
170-
build_pre_config_flags+=(
171-
--copt=-fno-omit-frame-pointer
172-
--copt=-fno-sanitize-recover=all
173-
--copt=-fsanitize=undefined
174-
--linkopt=-fsanitize=undefined
175-
)
156+
build_pre_config_flags+=(--features=ubsan --host_features=-ubsan)
176157
fi
177158
fi
178159
readonly build_pre_config_flags

0 commit comments

Comments
 (0)