Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ jobs:
run: ls -R mini*zip | tar -czvf minizip-ng-${{ matrix.deploy-name }}.tar.gz -T -

- name: Upload release (Ubuntu/macOS)
uses: svenstaro/upload-release-action@2.11.3
uses: svenstaro/upload-release-action@2.11.4
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.deploy && startsWith(github.ref, 'refs/tags/') && env.GITHUB_TOKEN != ''
with:
asset_name: minizip-ng-${{ matrix.deploy-name }}.tar.gz
Expand All @@ -312,7 +312,7 @@ jobs:
run: 7z a -tzip minizip-ng-${{ matrix.deploy-name }}.zip ./Release/mini*zip.exe

- name: Upload release (Windows)
uses: svenstaro/upload-release-action@2.11.3
uses: svenstaro/upload-release-action@2.11.4
if: runner.os == 'Windows' && matrix.deploy && startsWith(github.ref, 'refs/tags/') && env.GITHUB_TOKEN != ''
with:
asset_name: minizip-ng-${{ matrix.deploy-name }}.zip
Expand Down
25 changes: 8 additions & 17 deletions cmake/detect-sanitizer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ macro(add_common_sanitizer_flags)
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-g3)
endif()
# check_c_compiler_flag(-fno-omit-frame-pointer HAVE_NO_OMIT_FRAME_POINTER)
# if(HAVE_NO_OMIT_FRAME_POINTER)
check_c_compiler_flag(-fno-omit-frame-pointer HAVE_NO_OMIT_FRAME_POINTER)
if(HAVE_NO_OMIT_FRAME_POINTER)
add_compile_options(-fno-omit-frame-pointer)
add_link_options(-fno-omit-frame-pointer)
# endif()
# check_c_compiler_flag(-fno-optimize-sibling-calls HAVE_NO_OPTIMIZE_SIBLING_CALLS)
# if(HAVE_NO_OPTIMIZE_SIBLING_CALLS)
endif()
check_c_compiler_flag(-fno-optimize-sibling-calls HAVE_NO_OPTIMIZE_SIBLING_CALLS)
if(HAVE_NO_OPTIMIZE_SIBLING_CALLS)
add_compile_options(-fno-optimize-sibling-calls)
add_link_options(-fno-optimize-sibling-calls)
# endif()
endif()
endmacro()

macro(check_sanitizer_support known_checks supported_checks)
Expand Down Expand Up @@ -111,6 +111,7 @@ endmacro()

macro(add_undefined_sanitizer)
set(known_checks
alignment
array-bounds
bool
bounds
Expand All @@ -137,10 +138,6 @@ macro(add_undefined_sanitizer)
vptr
)

# Only check for alignment sanitizer flag if unaligned access is not supported
if(NOT WITH_UNALIGNED)
list(APPEND known_checks alignment)
endif()
# Object size sanitizer has no effect at -O0 and produces compiler warning if enabled
if(NOT CMAKE_C_FLAGS MATCHES "-O0")
list(APPEND known_checks object-size)
Expand All @@ -153,14 +150,8 @@ macro(add_undefined_sanitizer)
add_compile_options(-fsanitize=${supported_checks})
add_link_options(-fsanitize=${supported_checks})

# Group sanitizer flag -fsanitize=undefined will automatically add alignment, even if
# it is not in our sanitize flag list, so we need to explicitly disable alignment sanitizing.
if(WITH_UNALIGNED)
add_compile_options(-fno-sanitize=alignment)
endif()

add_common_sanitizer_flags()
else()
message(STATUS "Undefined behavior sanitizer is not supported")
endif()
endmacro()
endmacro()
Loading