File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ option(ASTCENC_DECOMPRESSOR "Enable astcenc builds for decompression only")
4444option (ASTCENC_SHAREDLIB "Enable astcenc builds with core library shared objects" )
4545option (ASTCENC_DIAGNOSTICS "Enable astcenc builds with diagnostic trace" )
4646option (ASTCENC_ASAN "Enable astcenc builds with address sanitizer" )
47+ option (ASTCENC_UBSAN "Enable astcenc builds with undefined behavior sanitizer" )
4748option (ASTCENC_UNITTEST "Enable astcenc builds with unit tests" )
4849option (ASTCENC_INVARIANCE "Enable astcenc floating point invariance" ON )
4950option (ASTCENC_CLI "Enable build of astcenc command line tools" ON )
@@ -129,6 +130,7 @@ printopt("Shared libs " ${ASTCENC_SHAREDLIB})
129130printopt ("Decompressor " ${ASTCENC_DECOMPRESSOR} )
130131printopt ("Diagnostics " ${ASTCENC_DIAGNOSTICS} )
131132printopt ("ASAN " ${ASTCENC_ASAN} )
133+ printopt ("UBSAN " ${ASTCENC_UBSAN} )
132134printopt ("Unit tests " ${ASTCENC_UNITTEST} )
133135
134136# Subcomponents
Original file line number Diff line number Diff line change @@ -225,11 +225,15 @@ cd build
225225ctest --verbose
226226```
227227
228- ### Address sanitizer builds
228+ ### Sanitizer builds
229229
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.
233237
234238### Android builds
235239
@@ -297,4 +301,4 @@ details.
297301
298302- - -
299303
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.
1616* ** General:**
1717 * ** Bug fix:** Native builds on macOS will now correctly build for arm64 when
1818 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.
1921
2022<!-- ---------------------------------------------------------------------- -->
2123## 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)
207207 $<${is_clang} :-fsanitize =address >)
208208 endif ()
209209
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+
210220 if (NOT ${ASTCENC_INVARIANCE} )
211221 target_compile_definitions (${ASTCENC_TARGET_NAME}
212222 PRIVATE
You can’t perform that action at this time.
0 commit comments