From: Nathan Moinvaziri Date: Mon, 26 Jan 2026 08:45:07 +0000 (-0800) Subject: Remove build script compiler checks for ctz builtins X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b6d1dd8bea5e40b70739717d7176bbae7e0ec57;p=thirdparty%2Fzlib-ng.git Remove build script compiler checks for ctz builtins --- diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be128122a..135bd5088 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -92,20 +92,6 @@ jobs: cmake-args: -DWITH_CHORBA=OFF codecov: ubuntu_gcc_no_chorba - - name: Ubuntu GCC No CTZLL - os: ubuntu-latest - compiler: gcc - cxx-compiler: g++ - cmake-args: -DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF - codecov: ubuntu_gcc_no_ctzll - - - name: Ubuntu GCC No CTZ - os: ubuntu-latest - compiler: gcc - cxx-compiler: g++ - cmake-args: -DWITH_OPTIM=OFF -DHAVE_BUILTIN_CTZLL=OFF -DHAVE_BUILTIN_CTZ=OFF - codecov: ubuntu_gcc_no_ctz - - name: Ubuntu GCC SSE2 UBSAN os: ubuntu-latest compiler: gcc diff --git a/CMakeLists.txt b/CMakeLists.txt index 20c9c3f61..34f11a61a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,42 +615,6 @@ if(HAVE_BUILTIN_ASSUME_ALIGNED) endif() set(CMAKE_REQUIRED_FLAGS) -# -# check for __builtin_ctz() support in the compiler -# -set(CMAKE_REQUIRED_FLAGS ${ZNOLTOFLAG}) -check_c_source_compiles( - "int main(void) { - unsigned int zero = 0; - long test = __builtin_ctz(zero); - (void)test; - return 0; - }" - HAVE_BUILTIN_CTZ -) -if(HAVE_BUILTIN_CTZ) - add_definitions(-DHAVE_BUILTIN_CTZ) -endif() -set(CMAKE_REQUIRED_FLAGS) - -# -# check for __builtin_ctzll() support in the compiler -# -set(CMAKE_REQUIRED_FLAGS ${ZNOLTOFLAG}) -check_c_source_compiles( - "int main(void) { - unsigned int zero = 0; - long test = __builtin_ctzll(zero); - (void)test; - return 0; - }" - HAVE_BUILTIN_CTZLL -) -if(HAVE_BUILTIN_CTZLL) - add_definitions(-DHAVE_BUILTIN_CTZLL) -endif() -set(CMAKE_REQUIRED_FLAGS) - # # check for ptrdiff_t support # diff --git a/configure b/configure index b3f60efc0..dc92bcdae 100755 --- a/configure +++ b/configure @@ -1142,32 +1142,6 @@ else echo "Checking for __builtin_assume_aligned() ... No." | tee -a configure.log fi -# Check for __builtin_ctz() support in compiler -cat > $test.c << EOF -long f(unsigned int x) { return __builtin_ctz(x); } -int main(void) { return 0; } -EOF -if try ${CC} ${CFLAGS} $test.c $LDSHAREDLIBC; then - echo "Checking for __builtin_ctz ... Yes." | tee -a configure.log - CFLAGS="$CFLAGS -DHAVE_BUILTIN_CTZ" - SFLAGS="$SFLAGS -DHAVE_BUILTIN_CTZ" -else - echo "Checking for __builtin_ctz ... No." | tee -a configure.log -fi - -# Check for __builtin_ctzll() support in compiler -cat > $test.c << EOF -long f(unsigned long long x) { return __builtin_ctzll(x); } -int main(void) { return 0; } -EOF -if try ${CC} ${CFLAGS} $test.c $LDSHAREDLIBC; then - echo "Checking for __builtin_ctzll ... Yes." | tee -a configure.log - CFLAGS="$CFLAGS -DHAVE_BUILTIN_CTZLL" - SFLAGS="$SFLAGS -DHAVE_BUILTIN_CTZLL" -else - echo "Checking for __builtin_ctzll ... No." | tee -a configure.log -fi - check_avx2_intrinsics() { # Check whether compiler supports AVX2 intrinsics cat > $test.c << EOF