language: c os: linux jobs: include: - compiler: clang - compiler: gcc - os: osx - env: - COVERITY_SCAN_BRANCH=1 addons: coverity_scan: project: name: ivmai/libatomic_ops version: 7.7.0 notification_email: ivmai@mail.ru branch_pattern: master build_command_prepend: CFLAGS=-march=native ./configure build_command: make -j check CFLAGS_EXTRA=-DLINT2 - env: - MAKEFILE_TARGET=dist - addons: apt: packages: - lcov compiler: gcc env: - CONF_OPTIONS="--enable-gcov --enable-shared" - CC_FOR_CHECK=gcc - MAKEFILE_TARGET=all - REPORT_COVERAGE=true - CFLAGS_EXTRA="-march=native -D DEBUG_RUN_ONE_TEST -D VERBOSE" - env: - CPPCHECK_ENABLE="-j16 -q --enable=information,performance,portability,style,warning" - MAKEFILE_TARGET=all - env: - CPPCHECK_ENABLE="-q --enable=unusedFunction -D AO_TEST_EMULATION" - MAKEFILE_TARGET=all - compiler: clang env: - CSA_CHECK=true - MAKEFILE_TARGET=all - CFLAGS_EXTRA="-D AO_TRACE_MALLOC -D HAVE_MMAP -D VERBOSE" - compiler: clang env: - CONF_OPTIONS="--disable-gpl" - arch: arm64 compiler: clang - arch: arm64 compiler: gcc - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test arch: arm64 compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-O3" - CONF_OPTIONS="--enable-assertions" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test arch: arm64 compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-O3 -D AO_AARCH64_ASM_LOAD_STORE_CAS -D AO_PREFER_BUILTIN_ATOMICS" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - gcc-11 sources: - ubuntu-toolchain-r-test arch: arm64 compiler: gcc-11 dist: bionic env: - CFLAGS_EXTRA="-O3 -march=armv8.2-a" - CONF_OPTIONS="--enable-shared" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test arch: arm64 compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-fsanitize=address -fno-omit-frame-pointer" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - musl-tools arch: arm64 compiler: musl-gcc env: - CFLAGS_EXTRA="-O3" - TESTS_CUSTOM_RUN=true - arch: arm64 compiler: gcc env: - CMAKE_CONFIG="Release" - arch: ppc64le compiler: clang - arch: ppc64le compiler: gcc - arch: ppc64le compiler: clang env: - CFLAGS_EXTRA="-O3" - CONF_OPTIONS="--enable-assertions --disable-atomic-intrinsics" - TESTS_CUSTOM_RUN=true - arch: ppc64le compiler: gcc env: - CFLAGS_EXTRA="-O3" - CONF_OPTIONS="--disable-atomic-intrinsics" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test arch: ppc64le compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-O3" - CONF_OPTIONS="--enable-assertions --enable-shared" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - gcc-11 sources: - ubuntu-toolchain-r-test arch: ppc64le compiler: gcc-11 dist: bionic env: - CFLAGS_EXTRA="-O3" - TESTS_CUSTOM_RUN=true - arch: ppc64le compiler: clang env: - CMAKE_CONFIG="Debug" - CMAKE_OPTIONS="-DBUILD_SHARED_LIBS=ON -Denable_assertions=ON -Denable_docs=OFF" - arch: ppc64le compiler: gcc env: - CMAKE_CONFIG="Release" - CMAKE_OPTIONS="-Denable_assertions=ON -Denable_atomic_intrinsics=OFF" - arch: s390x compiler: clang - arch: s390x compiler: gcc - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test arch: s390x compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-O3" - CONF_OPTIONS="--enable-assertions --enable-shared" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - gcc-11 sources: - ubuntu-toolchain-r-test arch: s390x compiler: gcc-11 dist: bionic env: - CFLAGS_EXTRA="-O3" - TESTS_CUSTOM_RUN=true - os: freebsd env: - CMAKE_CONFIG="Release" - CMAKE_OPTIONS="-Denable_gpl=OFF" - compiler: clang env: - CMAKE_CONFIG="Debug" - CMAKE_OPTIONS="-Denable_atomic_intrinsics=OFF" - compiler: gcc env: - CMAKE_CONFIG="Release" - CMAKE_OPTIONS="-DBUILD_SHARED_LIBS=ON -Dinstall_headers=OFF" - compiler: clang env: - CFLAGS_EXTRA="-O3 -march=native -funsigned-char" - CONF_OPTIONS="--enable-assertions" - compiler: gcc env: - CFLAGS_EXTRA="-O3 -march=native" - CONF_OPTIONS="--enable-assertions" - os: osx env: - CFLAGS_EXTRA="-O3 -march=native -D AO_USE_ALMOST_LOCK_FREE" - CONF_OPTIONS="--enable-assertions" - compiler: clang env: - CFLAGS_EXTRA="-march=native -std=c11" - compiler: clang env: - CFLAGS_EXTRA="-O3 -march=native -std=c11 -D AO_BL_SIZE=4 -D DEFAULT_NTHREADS=32" - compiler: gcc env: - CFLAGS_EXTRA="-march=native -D _FORTIFY_SOURCE=2 -std=c89" - addons: apt: packages: - gcc-multilib compiler: clang env: - CFLAGS_EXTRA="-m32" - CONF_OPTIONS="--enable-assertions" - addons: apt: packages: - gcc-multilib compiler: clang env: - CFLAGS_EXTRA="-m32 -O3 -march=native" - addons: apt: packages: - gcc-multilib compiler: clang env: - CFLAGS_EXTRA="-m32 -march=native" - CONF_OPTIONS="--disable-atomic-intrinsics" - addons: apt: packages: - gcc-multilib compiler: gcc env: - CFLAGS_EXTRA="-m32 -march=native -funsigned-char -D AO_USE_ALMOST_LOCK_FREE" - CONF_OPTIONS="--enable-assertions" - addons: apt: packages: - gcc-multilib compiler: gcc env: - CFLAGS_EXTRA="-m32 -march=native" - CONF_OPTIONS="--disable-atomic-intrinsics" - os: osx env: - CFLAGS_EXTRA="-m32 -march=native -D _FORTIFY_SOURCE=2" - CONF_OPTIONS="--enable-assertions" - compiler: gcc env: - CFLAGS_EXTRA="-D AO_GENERALIZE_ASM_BOOL_CAS -D AO_USE_NANOSLEEP -D AO_USE_NO_SIGNALS" - CONF_OPTIONS="--enable-assertions" - compiler: clang env: - CFLAGS_EXTRA="-D AO_STACK_PREFER_CAS_DOUBLE -D AO_USE_PTHREAD_DEFS" - CONF_OPTIONS="--enable-assertions" - compiler: clang env: - CFLAGS_EXTRA="-D DONT_USE_MMAP -O3" - CONF_OPTIONS="--enable-assertions --enable-shared" - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-O3 -march=native" - addons: apt: packages: - gcc-11 sources: - ubuntu-toolchain-r-test compiler: gcc-11 dist: bionic env: - CFLAGS_EXTRA="-O3 -march=native" - addons: apt: packages: - gcc-11 sources: - ubuntu-toolchain-r-test compiler: gcc-11 dist: bionic env: - CFLAGS_EXTRA="-O3 -march=native" - addons: apt: packages: - gcc-9 - gcc-9-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-9 env: - CFLAGS_EXTRA="-m32 -O3 -march=native" - addons: apt: packages: - gcc-9 - gcc-9-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-9 env: - CFLAGS_EXTRA="-mx32 -march=native -D _FORTIFY_SOURCE=2" - CONF_OPTIONS="--enable-assertions --enable-shared" - addons: apt: packages: - gcc-9 - gcc-9-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-9 env: - CFLAGS_EXTRA="-mx32 -march=native" - CONF_OPTIONS="--disable-atomic-intrinsics --disable-docs" - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-fsanitize=address -D AO_USE_ALMOST_LOCK_FREE -fno-omit-frame-pointer" - TESTS_CUSTOM_RUN=true - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-fsanitize=address -march=native -fno-common -fno-omit-frame-pointer" - CONF_OPTIONS="--enable-assertions" - compiler: gcc env: - CFLAGS_EXTRA="-fsanitize=address -fno-omit-frame-pointer -D AO_USE_ALMOST_LOCK_FREE -D USE_STANDARD_MALLOC" - CONF_OPTIONS="--enable-assertions" - addons: apt: packages: - gcc-9 - gcc-9-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-9 env: - CFLAGS_EXTRA="-fsanitize=address -m32 -march=native -fno-omit-frame-pointer" - LDFLAGS="-fuse-ld=gold" - os: osx env: - CFLAGS_EXTRA="-fsanitize=address -m32 -fno-omit-frame-pointer" - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-fsanitize=memory,undefined -march=native -fno-omit-frame-pointer" - TESTS_CUSTOM_RUN=true - compiler: clang env: - CFLAGS_EXTRA="-fsanitize=thread -D AO_USE_ALMOST_LOCK_FREE -fno-omit-frame-pointer" - addons: apt: packages: - clang-12 sources: - ubuntu-toolchain-r-test compiler: clang-12 dist: focal env: - CFLAGS_EXTRA="-fsanitize=thread -march=native -fno-omit-frame-pointer" - CONF_OPTIONS="--enable-assertions" - compiler: clang env: - CONF_OPTIONS="--disable-atomic-intrinsics" - CFLAGS_EXTRA="-march=native" - compiler: clang env: - CFLAGS_EXTRA="-x c++ -march=native -D VERBOSE" - CONF_OPTIONS="--enable-assertions" - MAKEFILE_TARGET=all - compiler: gcc env: - CC_FOR_CHECK=g++ - MAKEFILE_TARGET=all - addons: apt: packages: - musl-tools compiler: musl-gcc env: - CFLAGS_EXTRA="-march=native" - CONF_OPTIONS="--enable-assertions" - addons: apt: packages: - gcc-mingw-w64 compiler: x86_64-w64-mingw32-gcc env: - CONF_OPTIONS="--host=x86_64-w64-mingw32 --enable-shared --disable-static" - MAKEFILE_TARGET=all - addons: apt: packages: - gcc-mingw-w64 compiler: i686-w64-mingw32-gcc env: - CONF_OPTIONS="--host=i686-w64-mingw32" - MAKEFILE_TARGET=all - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=aarch64-linux - CFLAGS_EXTRA="-mabi=ilp32" - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=alpha-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=arm-linux-gnueabi - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=arm-linux-gnueabi - CFLAGS_EXTRA="-D AO_DISABLE_GCC_ATOMICS" - addons: apt: packages: - gcc-4.6 - gcc-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-4.6 env: - CROSS_GCC_VER=4.2.4 - NOLIBC_ARCH_ABI=avr32-linux - NOLIBC_DELIM=_ - CFLAGS_EXTRA="-fno-strict-aliasing" - addons: apt: packages: - gcc-4.6 - gcc-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-4.6 env: - CROSS_GCC_VER=4.6.3 - NOLIBC_ARCH_ABI=cris-linux - NOLIBC_DELIM=_ - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=hppa-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=ia64-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=m68k-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=mips-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=mips-linux - CFLAGS_EXTRA="-D AO_DISABLE_GCC_ATOMICS" - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=mips64-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=nios2-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=powerpc-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=powerpc-linux - CFLAGS_EXTRA="-D AO_DISABLE_GCC_ATOMICS" - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=powerpc64-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=riscv32-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=riscv64-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=s390-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=sh2-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=sh4-linux - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=sparc-linux - CFLAGS_EXTRA="-D AO_NO_SPARC_V9" - addons: apt: packages: - gcc-multilib env: - CROSS_GCC_VER=8.1.0 - NOLIBC_ARCH_ABI=sparc64-linux - addons: apt: packages: - gcc-4.6 - gcc-multilib sources: - ubuntu-toolchain-r-test compiler: gcc-4.6 env: - CROSS_GCC_VER=4.6.2 - NOLIBC_ARCH_ABI=tilegx-linux - NOLIBC_DELIM=_ - dist: focal env: - MAKEFILE_TARGET=distcheck - AUTOMAKE_VER=1.16.5 - LIBTOOL_VER=2.4.6 before_install: - if [[ "$CPPCHECK_ENABLE" != "" ]]; then CPPCHECK_VER=main; git clone --depth=3 https://github.com/danmar/cppcheck.git ~/cppcheck -b $CPPCHECK_VER; make --directory ~/cppcheck -j8 CXXFLAGS="-O3 -march=native -D NDEBUG"; fi - if [[ "$CROSS_GCC_VER" != "" ]]; then if [[ "$NOLIBC_DELIM" == "" ]]; then NOLIBC_DELIM=-; fi; BUILD_ARCH=x86_64; KERNEL_ORG_PUB_SITE=https://www.kernel.org/pub; TAR_FOLDER_URL=$KERNEL_ORG_PUB_SITE/tools/crosstool/files/bin/$BUILD_ARCH/$CROSS_GCC_VER; TARFILE=$BUILD_ARCH-gcc-$CROSS_GCC_VER-nolibc$NOLIBC_DELIM$NOLIBC_ARCH_ABI.tar.xz; wget --no-check-certificate -O - $TAR_FOLDER_URL/$TARFILE | tar xf - --xz --directory ~; CROSS_CC=~/gcc-$CROSS_GCC_VER-nolibc/$NOLIBC_ARCH_ABI/bin/$NOLIBC_ARCH_ABI-gcc; export C_INCLUDE_PATH=/usr/include; MAKEFILE_TARGET=check-nolink; fi - if [[ "$AUTOMAKE_VER" != "" || "$LIBTOOL_VER" != "" || "$M4_VER" != "" ]]; then GNUTOOLS_ROOT=`pwd`/../gnu-tools; export PATH=$GNUTOOLS_ROOT/bin:$PATH; GNU_DOWNLOAD_SITE=https://ftp.gnu.org/gnu; fi - if [[ "$M4_VER" != "" ]]; then M4_XZ_URL=$GNU_DOWNLOAD_SITE/m4/m4-$M4_VER.tar.xz; wget -O - $M4_XZ_URL | tar xf - --xz --directory ~; (cd ~/m4-$M4_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j check && make install); fi - if [[ "$LIBTOOL_VER" != "" ]]; then LIBTOOL_XZ_URL=$GNU_DOWNLOAD_SITE/libtool/libtool-$LIBTOOL_VER.tar.xz; wget -O - $LIBTOOL_XZ_URL | tar xf - --xz --directory ~; (cd ~/libtool-$LIBTOOL_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j && make install); fi - if [[ "$AUTOMAKE_VER" != "" ]]; then AUTOMAKE_XZ_URL=$GNU_DOWNLOAD_SITE/automake/automake-$AUTOMAKE_VER.tar.xz; wget -O - $AUTOMAKE_XZ_URL | tar xf - --xz --directory ~; (cd ~/automake-$AUTOMAKE_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j && make install); fi - if [[ "$MAKEFILE_TARGET" == "dist"* ]]; then autoconf --version; automake --version; m4 --version; libtool --version || true; fi - if [[ "$MAKEFILE_TARGET" == "" ]]; then MAKEFILE_TARGET=check; fi install: - if [[ "$CMAKE_CONFIG" == "" ]]; then ./autogen.sh; fi - if [[ "$REPORT_COVERAGE" == true ]]; then gem install coveralls-lcov; fi script: - if [[ "$CMAKE_CONFIG" == "" && "$COVERITY_SCAN_BRANCH" != 1 ]]; then ./configure $CONF_OPTIONS --enable-werror; fi - if [[ "$CSA_CHECK" != true && "$CMAKE_CONFIG" == "" && "$CPPCHECK_ENABLE" == "" && "$COVERITY_SCAN_BRANCH" != 1 ]]; then cat src/config.h; fi - if [[ "$CROSS_GCC_VER" != "" ]]; then CC=$CROSS_CC; fi - if [[ "$CMAKE_CONFIG" == "" && "$COVERITY_SCAN_BRANCH" != 1 ]]; then make -j $MAKEFILE_TARGET CC=$CC CFLAGS_EXTRA="$CFLAGS_EXTRA" LDFLAGS="$LDFLAGS"; fi - if [[ "$CMAKE_CONFIG" != "" ]]; then cmake $CMAKE_OPTIONS -Dbuild_tests=ON -Denable_werror=ON -Werror=deprecated . && cmake --build . --config $CMAKE_CONFIG; fi - if [[ "$CMAKE_CONFIG" != "" ]]; then ctest --build-config $CMAKE_CONFIG -V; fi - if [[ "$CC_FOR_CHECK" != "" ]]; then make check CC=$CC_FOR_CHECK CFLAGS_EXTRA="$CFLAGS_EXTRA"; fi - if [ -f tests/test_atomic.log ]; then cat tests/test_atomic*.log; fi - if [[ "$CSA_CHECK" == true ]]; then ${CC} --analyze -Xanalyzer -analyzer-output=text -Werror -I src $CFLAGS_EXTRA tests/*.c src/*.c; fi - if [[ "$CPPCHECK_ENABLE" != "" ]]; then ~/cppcheck/cppcheck -f --error-exitcode=2 -D CPPCHECK -I src $CPPCHECK_ENABLE src/*.c tests/test_malloc.c tests/test_stack.c; fi - if [[ "$TESTS_CUSTOM_RUN" == true ]]; then ASAN_OPTIONS="detect_leaks=1" UBSAN_OPTIONS="halt_on_error=1" make -C tests check-without-test-driver; fi after_success: - if [[ "$REPORT_COVERAGE" == true ]]; then lcov --capture --directory src --directory tests --output-file coverage.info; lcov --remove coverage.info '/usr/*' 'tests/*' --output-file coverage.info; lcov --list coverage.info; coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info; bash <(curl -s https://codecov.io/bash); fi deploy: provider: releases edge: true file: libatomic_ops-*.tar.gz file_glob: true on: condition: $MAKEFILE_TARGET = distcheck repo: ivmai/libatomic_ops tags: true