codecov: ubuntu_gcc_osb
cflags: -O1 -g3
- - name: Ubuntu GCC -O3
+ - name: Ubuntu GCC -O3 No Unaligned
os: ubuntu-latest
compiler: gcc
cxx-compiler: g++
+ cmake-args: -DWITH_UNALIGNED=OFF
codecov: ubuntu_gcc_o3
cflags: -O3
option(WITH_CODE_COVERAGE "Enable code coverage reporting" OFF)
option(WITH_INFLATE_STRICT "Build with strict inflate distance checking" OFF)
option(WITH_INFLATE_ALLOW_INVALID_DIST "Build with zero fill for inflate invalid distances" OFF)
+option(WITH_UNALIGNED "Support unaligned reads on platforms that support it" ON)
set(ZLIB_SYMBOL_PREFIX "" CACHE STRING "Give this prefix to all publicly exported symbols.
Useful when embedding into a larger library.
WITH_POWER8
WITH_INFLATE_STRICT
WITH_INFLATE_ALLOW_INVALID_DIST
+ WITH_UNALIGNED
INSTALL_UTILS
)
endif()
endif()
+# Set architecture alignment requirements
+if(NOT WITH_UNALIGNED)
+ add_definitions(-DNO_UNALIGNED)
+ message(STATUS "Unaligned reads manually disabled")
+endif()
+
# Apply warning compiler flags
if(WITH_MAINTAINER_WARNINGS)
add_compile_options(${WARNFLAGS} ${WARNFLAGS_MAINTAINER} ${WARNFLAGS_DISABLE})
| WITH_CRC32_VX | --without-crc32-vx | Build with vectorized CRC32 on IBM Z | ON |
| WITH_DFLTCC_DEFLATE | --with-dfltcc-deflate | Build with DFLTCC intrinsics for compression on IBM Z | OFF |
| WITH_DFLTCC_INFLATE | --with-dfltcc-inflate | Build with DFLTCC intrinsics for decompression on IBM Z | OFF |
+| WITH_UNALIGNED | --without-unaligned | Allow optimizations that use unaligned reads if safe on current arch| ON |
| WITH_INFLATE_STRICT | | Build with strict inflate distance checking | OFF |
| WITH_INFLATE_ALLOW_INVALID_DIST | | Build with zero fill for inflate invalid distances | OFF |
| INSTALL_UTILS | | Copy minigzip and minideflate during install | OFF |
shared_ext='.so'
shared=1
gzfileops=1
+unalignedok=1
compat=0
cover=0
build32=0
echo ' [--warn] Enables extra compiler warnings' | tee -a configure.log
echo ' [--debug] Enables extra debug prints during operation' | tee -a configure.log
echo ' [--zlib-compat] Compiles for zlib-compatible API instead of zlib-ng API' | tee -a configure.log
- echo ' [--without-gzfileops] Compiles with the gzfile parts of the API enabled' | tee -a configure.log
+ echo ' [--without-unaligned] Compiles without fast unaligned access' | tee -a configure.log
+ echo ' [--without-gzfileops] Compiles without the gzfile parts of the API enabled' | tee -a configure.log
echo ' [--without-optimizations] Compiles without support for optional instruction sets' | tee -a configure.log
echo ' [--without-new-strategies] Compiles without using new additional deflate strategies' | tee -a configure.log
echo ' [--without-acle] Compiles without ARM C Language Extensions' | tee -a configure.log
-s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static) shared=0; shift ;;
--zlib-compat) compat=1; shift ;;
+ --without-unaligned) unalignedok=0; shift ;;
--without-gzfileops) gzfileops=0; shift ;;
--cover) cover=1; shift ;;
-3* | --32) build32=1; shift ;;
PIC_TESTOBJG="\$(OBJG)"
fi
+# set architecture alignment requirements
+if test $unalignedok -eq 0; then
+ CFLAGS="${CFLAGS} -DNO_UANLIGNED"
+ SFLAGS="${SFLAGS} -DNO_UNALIGNED"
+ echo "Unaligned reads manually disabled." | tee -a configure.log
+fi
+
# enable reduced memory configuration
if test $reducedmem -eq 1; then
echo "Configuring for reduced memory environment." | tee -a configure.log
# define Tracecv(c, x)
#endif
-#if defined(__x86_64__) || defined(_M_X64) || defined(__amd64__) || defined(_M_AMD64)
-# define UNALIGNED_OK
-# define UNALIGNED64_OK
-#elif defined(__i386__) || defined(__i486__) || defined(__i586__) || \
- defined(__i686__) || defined(_X86_) || defined(_M_IX86)
-# define UNALIGNED_OK
-#elif defined(__aarch64__) || defined(_M_ARM64)
-# if (defined(__GNUC__) && defined(__ARM_FEATURE_UNALIGNED)) || !defined(__GNUC__)
+#ifndef NO_UNALIGNED
+# if defined(__x86_64__) || defined(_M_X64) || defined(__amd64__) || defined(_M_AMD64)
# define UNALIGNED_OK
# define UNALIGNED64_OK
-# endif
-#elif defined(__arm__) || (_M_ARM >= 7)
-# if (defined(__GNUC__) && defined(__ARM_FEATURE_UNALIGNED)) || !defined(__GNUC__)
-# define UNALIGNED_OK
-# endif
-#elif defined(__powerpc64__) || defined(__ppc64__)
-# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# elif defined(__i386__) || defined(__i486__) || defined(__i586__) || \
+ defined(__i686__) || defined(_X86_) || defined(_M_IX86)
# define UNALIGNED_OK
-# define UNALIGNED64_OK
+# elif defined(__aarch64__) || defined(_M_ARM64)
+# if (defined(__GNUC__) && defined(__ARM_FEATURE_UNALIGNED)) || !defined(__GNUC__)
+# define UNALIGNED_OK
+# define UNALIGNED64_OK
+# endif
+# elif defined(__arm__) || (_M_ARM >= 7)
+# if (defined(__GNUC__) && defined(__ARM_FEATURE_UNALIGNED)) || !defined(__GNUC__)
+# define UNALIGNED_OK
+# endif
+# elif defined(__powerpc64__) || defined(__ppc64__)
+# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define UNALIGNED_OK
+# define UNALIGNED64_OK
+# endif
# endif
#endif