File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ option(ASTCENC_DECOMPRESSOR "Enable astcenc builds for decompression only")
44
44
option (ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects" )
45
45
option (ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace" )
46
46
option (ASTCENC_ASAN "Enable astcenc builds with address sanitizer" )
47
+ option (ASTCENC_UBSAN "Enable astcenc builds with undefined behavior sanitizer" )
47
48
option (ASTCENC_UNITTEST "Enable astcenc builds with unit tests" )
48
49
option (ASTCENC_INVARIANCE "Enable astcenc floating point invariance" ON )
49
50
option (ASTCENC_CLI "Enable build of astcenc command line tools" ON )
@@ -129,6 +130,7 @@ printopt("Shared libs " ${ASTCENC_SHAREDLIB})
129
130
printopt ("Decompressor " ${ASTCENC_DECOMPRESSOR} )
130
131
printopt ("Diagnostics " ${ASTCENC_DIAGNOSTICS} )
131
132
printopt ("ASAN " ${ASTCENC_ASAN} )
133
+ printopt ("UBSAN " ${ASTCENC_UBSAN} )
132
134
printopt ("Unit tests " ${ASTCENC_UNITTEST} )
133
135
134
136
# Subcomponents
Original file line number Diff line number Diff line change @@ -225,11 +225,15 @@ cd build
225
225
ctest --verbose
226
226
```
227
227
228
- ### Address sanitizer builds
228
+ ### Sanitizer builds
229
229
230
- We support building with ASAN on Linux and macOS when using a compiler that
231
- supports it. To build binaries with ASAN checking enabled add ` -DASTCENC_ASAN=ON `
232
- to the CMake command line when configuring.
230
+ We support building with sanitizers on Linux and macOS when using Clang.
231
+
232
+ To build binaries with ASAN checking enabled add ` -DASTCENC_ASAN=ON ` to the
233
+ CMake command line when configuring.
234
+
235
+ To build binaries with UBSAN checking enabled add ` -DASTCENC_UBSAN=ON ` to the
236
+ CMake command line when configuring.
233
237
234
238
### Android builds
235
239
@@ -297,4 +301,4 @@ details.
297
301
298
302
- - -
299
303
300
- _ Copyright © 2019-2023 , Arm Limited and contributors. All rights reserved._
304
+ _ Copyright © 2019-2024 , Arm Limited and contributors. All rights reserved._
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ The 4.8.0 release is a minor maintenance release.
16
16
* ** General:**
17
17
* ** Bug fix:** Native builds on macOS will now correctly build for arm64 when
18
18
run outside of Rosetta on an Apple silicon device.
19
+ * ** Feature:** Builds using Clang can now build with undefined behavior
20
+ sanitizer by setting ` -DASTCENC_UBSAN=ON ` on the CMake configure line.
19
21
20
22
<!-- ---------------------------------------------------------------------- -->
21
23
## 4.7.0
Original file line number Diff line number Diff line change @@ -207,6 +207,16 @@ macro(astcenc_set_properties ASTCENC_TARGET_NAME ASTCENC_IS_VENEER)
207
207
$< ${is_clang} :-fsanitize=address> )
208
208
endif ()
209
209
210
+ if (${ASTCENC_UBSAN} )
211
+ target_compile_options (${ASTCENC_TARGET_NAME}
212
+ PRIVATE
213
+ $< ${is_clang} :-fsanitize=undefined> )
214
+
215
+ target_link_options (${ASTCENC_TARGET_NAME}
216
+ PRIVATE
217
+ $< ${is_clang} :-fsanitize=undefined> )
218
+ endif ()
219
+
210
220
if (NOT ${ASTCENC_INVARIANCE} )
211
221
target_compile_definitions (${ASTCENC_TARGET_NAME}
212
222
PRIVATE
You can’t perform that action at this time.
0 commit comments