From 999c4d268dac224b4ce3506382ca12ba6c43e52b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 9 Nov 2023 07:49:05 +0300 Subject: [PATCH] DRAFT 601 - test GH Actions with some fixes --- .appveyor.yml | 178 ------- .github/workflows/cmake-build.yml | 28 +- .travis.yml | 800 ------------------------------ CMakeLists.txt | 21 +- include/gc/gc.h | 2 +- include/gc/gc_inline.h | 5 +- include/private/gc_priv.h | 18 +- include/private/gcconfig.h | 9 +- include/private/pthread_support.h | 6 +- os_dep.c | 26 +- pthread_stop_world.c | 23 +- pthread_support.c | 22 +- win32_threads.c | 8 +- 13 files changed, 89 insertions(+), 1057 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index e70842781..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,178 +0,0 @@ -version: 8.3.0-{build} - -image: -- Visual Studio 2019 - -environment: - STUDIO_VERSION_EDITION: Studio\2019\Community - CMAKE_CONFIG: Debug - TEST_TARGET: check - matrix: - - TARGET: cmake - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON -Werror=deprecated -Dwithout_libatomic_ops=ON - - TARGET: cmake - CMAKE_OPTIONS: -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_throw_bad_alloc_library=OFF -Denable_gc_assertions=ON -Denable_gc_debug=ON -Denable_threads=OFF - - TARGET: cmake - CFLAGS_EXTRA: -DNO_MSGBOX_ON_ERROR -DNO_MPROTECT_VDB -DGC_READ_ENV_FILE - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_large_config=ON -Ddisable_gc_debug=ON -Denable_dynamic_pointer_mask=ON -Denable_rwlock=ON - - TARGET: cmake - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=MinSizeRel -Denable_parallel_mark=OFF - - TARGET: cmake - CMAKE_OPTIONS: -Denable_gc_assertions=ON -Denable_thread_local_alloc=OFF -Ddisable_single_obj_compilation=ON - - TARGET: cmake - CFLAGS_EXTRA: -DGC_DISABLE_INCREMENTAL - CMAKE_OPTIONS: -Denable_gc_assertions=ON -Denable_gcj_support=OFF -Denable_parallel_mark=OFF -Denable_thread_local_alloc=OFF - - TARGET: cmake - CMAKE_OPTIONS: -A Win32 -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON -Denable_large_config=ON - - TARGET: cmake - CMAKE_OPTIONS: -A ARM -Denable_cplusplus=ON -Denable_gc_assertions=ON - - TARGET: cmake - CMAKE_OPTIONS: -A ARM64 -DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON - CMAKE_CONFIG: Release - - TARGET: nmake - ARCH: x86 - NMAKE_OPTIONS: enable_static=1 - - TARGET: nmake - ARCH: x64 - CFLAGS_EXTRA: /J - - TARGET: nmake - ARCH: x86 - NMAKE_OPTIONS: nodebug=1 - - TARGET: nmake - ARCH: x64 - NMAKE_OPTIONS: disable_threads=1 - - TARGET: djgpp-no-make - CFLAGS_EXTRA: -O3 -DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE -DGC_GCJ_SUPPORT - - TARGET: dmc - CFLAGS_EXTRA: -s - - TARGET: mingw - - TARGET: mingw - CFLAGS_EXTRA: -D GC_THREADS -D THREAD_LOCAL_ALLOC -D PARALLEL_MARK -D GC_ASSERTIONS -D EMPTY_GETENV_RESULTS -D GC_GCJ_SUPPORT -D USE_MUNMAP -D LARGE_CONFIG -D NO_MSGBOX_ON_ERROR - TEST_TARGET: check cord/de - - TARGET: mingw - CFLAGS_EXTRA: -O3 -march=native -D GC_THREADS -D GC_GCJ_SUPPORT -D GC_TIME_LIMIT=10 -D WINXP_USE_PERF_COUNTER -D NO_MSGBOX_ON_ERROR -D NO_TEST_ENDTHREADEX - - TARGET: mingw-shared-no-make - CFLAGS_EXTRA: -D GC_THREADS -D GC_ASSERTIONS -D ENABLE_DISCLAIM -D GC_GCJ_SUPPORT -D GC_PREFER_MPROTECT_VDB -D GC_CALL=__stdcall -D GC_CALLBACK=__fastcall -D CONSOLE_LOG -D NO_MSGBOX_ON_ERROR -D USE_RWLOCK -D _WIN32_WINNT=0x0600 - - TARGET: wcc - WCC_SYSTEM: OS2 - CFLAGS_EXTRA: -DGC_ASSERTIONS - ENABLE_STATIC_OPT: "ENABLE_STATIC=1" - TEST_TARGET: check-deps - WCC_INC_SUBDIR: os2 - - TARGET: wcc - WCC_SYSTEM: MSWIN32 - CFLAGS_EXTRA: -DCONSOLE_LOG -DUSE_MMAP -DUSE_MUNMAP - WCC_INC_SUBDIR: nt - - TARGET: mingw-w64 - CFLAGS_EXTRA: -D NO_MSGBOX_ON_ERROR - - TARGET: mingw-w64 - CFLAGS_EXTRA: -D GC_THREADS -D THREAD_LOCAL_ALLOC -D PARALLEL_MARK -D GC_ASSERTIONS -D GC_GCJ_SUPPORT -D NO_RETRY_GET_THREAD_CONTEXT - - TARGET: cygwin - CONF_OPTIONS: --enable-cplusplus - CFLAGS_EXTRA: -D GCTEST_PRINT_VERBOSE - - TARGET: cygwin64 - CONF_OPTIONS: --disable-threads - CFLAGS_EXTRA: -std=c11 -D USE_WINALLOC - - TARGET: cygwin64 - CONF_OPTIONS: --enable-cplusplus - CFLAGS_EXTRA: -D GCTEST_PRINT_VERBOSE - - TARGET: cygwin - CONF_OPTIONS: --enable-cplusplus --disable-munmap --enable-gc-assertions --enable-redirect-malloc - - TARGET: cygwin64 - CFLAGS_EXTRA: -D GC_ALWAYS_MULTITHREADED -D LINT2 -D TEST_MANUAL_VDB - CONF_OPTIONS: --enable-cplusplus --enable-gc-assertions --enable-rwlock --disable-shared - -clone_depth: 50 - -install: -- cmd: git clone --depth=50 https://github.com/ivmai/libatomic_ops.git - -build_script: -- cmd: if [%TARGET%]==[cmake] ( - mkdir out && cd out - && cmake %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" .. - && cmake --build . --config %CMAKE_CONFIG% --verbose ) -- cmd: if [%TARGET%]==[nmake] ( - "C:\Program Files (x86)\Microsoft Visual %STUDIO_VERSION_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% - && nmake /f NT_MAKEFILE %NMAKE_OPTIONS% CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%" ) -- cmd: if [%TARGET%]==[cygwin] ( - C:\cygwin\bin\bash -e -l -c - "cd /cygdrive/c/projects/bdwgc && ./autogen.sh - && ./configure %CONF_OPTIONS% --enable-werror && cat include/config.h - && make -j CFLAGS_EXTRA='%CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[cygwin64] ( - C:\cygwin64\bin\bash -e -l -c - "cd /cygdrive/c/projects/bdwgc && ./autogen.sh - && ./configure %CONF_OPTIONS% --enable-werror && cat include/config.h - && make -j CFLAGS_EXTRA='%CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[djgpp-no-make] ( - appveyor DownloadFile "https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-mingw-gcc1220-standalone.zip" - && 7z x -o.. djgpp-mingw-gcc1220-standalone.zip > nul - && ..\djgpp\setenv.bat - && gcc -I include -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA% -c extra/gc.c ) -- cmd: if [%TARGET%]==[dmc] ( - appveyor DownloadFile "http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip" - && 7z x -o.. dm857c.zip > nul && set "path=%cd%\..\dm\bin;%path%" - && make -f digimars.mak CFLAGS_EXTRA="-wx %CFLAGS_EXTRA%" ) -- cmd: if [%TARGET%]==[mingw] ( - C:\MinGW\msys\1.0\bin\bash -e -l -c - "cd /c/projects/bdwgc - && make -j -f Makefile.direct CC=gcc CFLAGS_EXTRA='-Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[mingw-shared-no-make] ( - C:\MinGW\msys\1.0\bin\bash -e -l -c - "cd /c/projects/bdwgc - && gcc -I include -D GC_BUILTIN_ATOMIC -D GC_DLL -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA% -shared -o gc.dll extra/gc.c" ) -- cmd: if [%TARGET%]==[mingw-w64] ( - C:\msys64\usr\bin\bash -e -l -c - "cd /c/projects/bdwgc - && make -j -f Makefile.direct CC=gcc CFLAGS_EXTRA='-Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[wcc] ( - appveyor DownloadFile "https://github.com/open-watcom/open-watcom-v2/releases/download/2023-05-09-Build/ow-snapshot.tar.xz" - && 7z x ow-snapshot.tar.xz > nul && 7z x -o..\watcom ow-snapshot.tar > nul - && set "watcom=%cd%\..\watcom" && set "path=%cd%\..\watcom\binnt64" - && set "include=%cd%\..\watcom\h\%WCC_INC_SUBDIR%;%cd%\..\watcom\h" - && wmake -f WCC_MAKEFILE SYSTEM=%WCC_SYSTEM% %ENABLE_STATIC_OPT% CFLAGS_EXTRA="-we %CFLAGS_EXTRA%" ) - -test_script: -- cmd: if [%TARGET%]==[cmake] ( ctest --build-config %CMAKE_CONFIG% -j4 -V ) -- cmd: if [%TARGET%]==[nmake] ( - "C:\Program Files (x86)\Microsoft Visual %STUDIO_VERSION_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %ARCH% - && nmake /f NT_MAKEFILE %TEST_TARGET% %NMAKE_OPTIONS% CFLAGS_EXTRA="/WX %CFLAGS_EXTRA%" - && nmake /f NT_MAKEFILE clean ) -- cmd: if [%TARGET%]==[cygwin] ( - C:\cygwin\bin\bash -e -l -c - "cd /cygdrive/c/projects/bdwgc - && make -j check-without-test-driver CFLAGS_EXTRA='%CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[cygwin64] ( - C:\cygwin64\bin\bash -e -l -c - "cd /cygdrive/c/projects/bdwgc - && make -j check-without-test-driver CFLAGS_EXTRA='%CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[djgpp-no-make] ( - ..\djgpp\setenv.bat - && gcc -I include -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA% -o cordtest.exe cord/tests/cordtest.c cord/*.c gc.o - && gcc -I include -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA% -v -o gctest.exe tests/gctest.c gc.o ) -- cmd: if [%TARGET%]==[dmc] ( - set "path=%cd%\..\dm\bin;%path%" - && make -f digimars.mak %TEST_TARGET% CFLAGS_EXTRA="-wx %CFLAGS_EXTRA%" - && type gctest.gc.log cpptest.gc.log - && make -f digimars.mak clean ) -- cmd: if [%TARGET%]==[mingw] ( - C:\MinGW\msys\1.0\bin\bash -e -l -c - "cd /c/projects/bdwgc - && make -j -f Makefile.direct %TEST_TARGET% CC=gcc CURSES=-lgdi32 CFLAGS_EXTRA='-DGC_NOT_DLL -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[mingw-shared-no-make] ( - C:\MinGW\msys\1.0\bin\bash -e -l -c - "cd /c/projects/bdwgc - && gcc -I include -D GC_BUILTIN_ATOMIC -D GC_DLL -Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA% -o gctest.exe tests/gctest.c gc.dll - && gctest.exe" ) -- cmd: if [%TARGET%]==[mingw-w64] ( - C:\msys64\usr\bin\bash -e -l -c - "cd /c/projects/bdwgc - && make -j -f Makefile.direct %TEST_TARGET% CC=gcc CFLAGS_EXTRA='-Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA%'" ) -- cmd: if [%TARGET%]==[wcc] ( - set "watcom=%cd%\..\watcom" && set "beginlibpath=%cd%\..\watcom\binp\dll" - && set "path=%cd%\..\watcom\binnt64;%cd%\..\watcom\binnt" - && wmake -f WCC_MAKEFILE %TEST_TARGET% SYSTEM=%WCC_SYSTEM% %ENABLE_STATIC_OPT% CFLAGS_EXTRA="-we %CFLAGS_EXTRA%" - && wmake -f WCC_MAKEFILE clean ) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index ee697ca75..745833db2 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -25,6 +25,8 @@ jobs: exclude: - os: macos-latest c_compiler: cl + - enable_threads: on + redirect_malloc: on - os: macos-latest c_compiler: gcc - os: ubuntu-latest @@ -32,26 +34,18 @@ jobs: - os: windows-latest # TODO: support dependency on libatomic_ops c_compiler: cl enable_threads: on - - os: windows-latest # TODO: enable following - c_compiler: clang - - os: macos-latest - c_compiler: clang - enable_threads: on - redirect_malloc: on - - os: windows-latest - c_compiler: cl - enable_threads: off - redirect_malloc: on - - os: windows-latest - c_compiler: gcc - enable_threads: on + #- os: windows-latest + # c_compiler: clang + #- os: windows-latest + # c_compiler: gcc + # enable_threads: on include: - os: windows-latest c_compiler: gcc cmake_generator_opt: '-G "Unix Makefiles"' - #- os: windows-latest - # c_compiler: clang - # cmake_generator_opt: '-G "Unix Makefiles"' + - os: windows-latest + c_compiler: clang + cmake_generator_opt: '-G "Unix Makefiles"' steps: - uses: actions/checkout@v4 @@ -80,6 +74,8 @@ jobs: -Denable_werror=ON -Werror=dev -S ${{ github.workspace }} +# -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} +# -Denable_cplusplus=ON - name: Build # Build the code with the given configuration. diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7eaef0e1c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,800 +0,0 @@ -language: cpp -os: linux -dist: jammy - -jobs: - include: - - compiler: clang - env: - - CONF_OPTIONS="--enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--enable-cplusplus" - - os: osx - env: - - CONF_OPTIONS="--enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - env: - - COVERITY_SCAN_BRANCH=1 - addons: - coverity_scan: - project: - name: ivmai/bdwgc - version: 8.3.0 - notification_email: ivmai@mail.ru - branch_pattern: master - build_command_prepend: "./configure --enable-cplusplus --disable-shared --enable-single-obj-compilation" - build_command: make -j check CFLAGS_EXTRA=-DLINT2 - - addons: - apt: - packages: - - lcov - compiler: gcc - env: - - CONF_OPTIONS="--enable-gcov --enable-single-obj-compilation --enable-cplusplus --disable-shared --enable-gc-assertions" - - CFLAGS_EXTRA="-D USE_CUSTOM_SPECIFIC" - - CC_FOR_CHECK=g++ - - MAKEFILE_TARGETS="all" - - MAKEFILE_TARGETS_CHECK="check" - - NO_CLONE_LIBATOMIC_OPS=true - - REPORT_COVERAGE=true - - TESTS_CUSTOM_RUN=true - - env: - - MAKEFILE_TARGETS="dist" - - os: osx - env: - - CSA_CHECK=true - - CFLAGS_EXTRA="-m32" - - compiler: clang - language: c - env: - - CSA_CHECK=true - - CFLAGS_EXTRA="-D ALL_INTERIOR_POINTERS -D CHECKSUMS -D DBG_HDRS_ALL -D DEBUG_THREADS -D ENABLE_TRACE -D GC_ALWAYS_MULTITHREADED -D GC_ASSERTIONS -D GC_ATOMIC_UNCOLLECTABLE -D GC_ENABLE_SUSPEND_THREAD -D GC_GCJ_SUPPORT -D GC_PRINT_BACK_HEIGHT -D GC_THREADS -D HANDLE_FORK -D JAVA_FINALIZATION -D KEEP_BACK_PTRS -D MAKE_BACK_GRAPH -D PARALLEL_MARK -D PRINT_BLACK_LIST -D THREAD_LOCAL_ALLOC -D USE_MMAP -D USE_MUNMAP" - - dist: xenial - env: - - CPPCHECK_ENABLE="--enable=unusedFunction -I libatomic_ops/src extra/gc.c tests/*.c" - - dist: xenial - env: - - CPPCHECK_ENABLE="--enable=unusedFunction --force -D GC_BUILTIN_ATOMIC *.cc cord/*.c cord/tests/*.c tests/*.c tests/*.cc" - - CPPCHECK_OUT_FILTER="Z" - - NO_CLONE_LIBATOMIC_OPS=true - - dist: xenial - env: - - CPPCHECK_ENABLE="-j4 --enable=information,performance,portability,style,warning --force -U GC_PRIVATE_H -I libatomic_ops/src a*.c b*.c c*.c d*.c f*.c g*.c h*.c m*.c" - - dist: xenial - env: - - CPPCHECK_ENABLE="-j4 --enable=information,performance,portability,style,warning --force -U GC_PRIVATE_H -I libatomic_ops/src n*.c o*.c p*.c r*.c s*.c t*.c w*.c" - - dist: xenial - env: - - CPPCHECK_ENABLE="-j4 --enable=information,performance,portability,style,warning --force -U GC_PRIVATE_H -I libatomic_ops/src *.cc cord/*.c cord/tests/*.c extra/AmigaOS.c extra/MacOS.c extra/msvc_dbg.c extra/symbian.cpp tests/*.c tests/*.cc tools/*.c" - - arch: arm64 - compiler: clang - - arch: arm64 - compiler: gcc - - arch: arm64 - compiler: clang - env: - - CFLAGS_EXTRA="-O3" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --disable-shared" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -D SIMULATE_LOST_SIGNALS -D TRACE_BUF" - - CONF_OPTIONS="--enable-cplusplus --disable-gcj-support" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - musl-tools - arch: arm64 - compiler: musl-gcc - dist: focal - language: c - env: - - CFLAGS_EXTRA="-O3 -D SOFT_VDB" - - CONF_OPTIONS="--enable-gc-assertions" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: gcc - env: - - CONF_OPTIONS="--disable-threads" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - addons: - apt: - packages: - - libatomic-ops-dev - compiler: gcc - env: - - CONF_OPTIONS="--with-libatomic-ops=yes --enable-gc-assertions --enable-cplusplus --disable-munmap" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: clang - language: c - env: - - CFLAGS_EXTRA="-fsanitize=memory,undefined -fno-omit-frame-pointer" - - CONF_OPTIONS="--enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - TESTS_CUSTOM_RUN=true - - arch: arm64 - compiler: clang - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -Dbuild_tests=ON -DBUILD_SHARED_LIBS=OFF -Denable_cplusplus=ON -Denable_gc_assertions=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: gcc - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - arch: ppc64le - compiler: clang - - arch: ppc64le - compiler: gcc - env: - - CONF_OPTIONS="--disable-disclaim" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - env: - - CFLAGS_EXTRA="-O3 -D _FORTIFY_SOURCE=2 -D FORCE_MPROTECT_BEFORE_MADVISE" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -D NO_MPROTECT_VDB" - - CONF_OPTIONS="--enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - env: - - CFLAGS_EXTRA="-D CHECK_SOFT_VDB" - - CONF_OPTIONS="--enable-gc-assertions --enable-static --disable-thread-local-alloc" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - language: c - env: - - CFLAGS_EXTRA="-fsanitize=memory,undefined -fno-omit-frame-pointer" - - CONF_OPTIONS="--disable-shared" - - NO_CLONE_LIBATOMIC_OPS=true - - TESTS_CUSTOM_RUN=true - - arch: ppc64le - compiler: clang - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - arch: s390x - compiler: clang - dist: focal - - arch: s390x - compiler: gcc - dist: focal - - addons: - apt: - packages: - - clang-12 - arch: s390x - compiler: clang-12 - dist: focal - env: - - CC=clang-12 - - CXX=clang++-12 - - CFLAGS_EXTRA="-O3 -flto -D _FORTIFY_SOURCE=2 -D NO_RETRY_SIGNALS" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-dynamic-pointer-mask" - - addons: - apt: - packages: - - g++-10 - arch: s390x - compiler: g++-10 - dist: focal - env: - - CC=gcc-10 - - CXX=g++-10 - - CFLAGS_EXTRA="-O3 -flto=auto -D _FORTIFY_SOURCE=2 -D PREFER_MMAP_PROT_NONE" - - CONF_OPTIONS="--enable-cplusplus --disable-shared" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: s390x - compiler: gcc - dist: focal - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - os: freebsd - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-cplusplus --enable-gc-assertions --enable-rwlock" - - MAKE_NPROC=8 - - NO_CLONE_LIBATOMIC_OPS=true - - os: freebsd - env: - - CONF_OPTIONS="--enable-cplusplus" - - MAKE_NPROC=8 - - NO_CLONE_LIBATOMIC_OPS=true - - os: freebsd - env: - - CONF_OPTIONS="--enable-gc-assertions --disable-shared" - - MAKE_NPROC=8 - - NO_CLONE_LIBATOMIC_OPS=true - - os: freebsd - env: - - CMAKE_BUILD_OPTIONS="--verbose" - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - os: freebsd - compiler: clang - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - MAKE_NPROC=8 - - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -march=native" - - CONF_OPTIONS="--enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: clang - env: - - CFLAGS_EXTRA="-m32 -funsigned-char -D _FORTIFY_SOURCE=2 -D NO_LONGLONG64" - - CONF_OPTIONS="--enable-gc-assertions" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: gcc - env: - - CFLAGS_EXTRA="-m32 -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-gc-assertions --enable-mmap --enable-rwlock" - - os: osx - env: - - CFLAGS_EXTRA="-m32 -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--disable-threads --enable-checksums --disable-munmap --enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2 -D DBG_HDRS_ALL -D SHORT_DBG_HDRS" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CFLAGS_EXTRA="-D DBG_HDRS_ALL -D SHORT_DBG_HDRS -D LINT2 -D PRINT_AND_CHECK_INT_LIST" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-handle-fork=manual --disable-throw-bad-alloc-library" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-D DEBUG_ADD_DEL_ROOTS -D DEBUG_THREADS -D GC_DEBUG -D GC_LOG_TO_FILE_ALWAYS" - - CONF_OPTIONS="--enable-cplusplus" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D BSD_TIME -D DEFAULT_STACK_MAYBE_SMALL -D ENABLE_TRACE -D EMPTY_GETENV_RESULTS -D GC_ALWAYS_MULTITHREADED -D GC_NETBSD_THREADS_WORKAROUND -D CPPCHECK" - - CONF_OPTIONS="--enable-cplusplus --enable-gc-assertions" - - compiler: clang - env: - - CFLAGS_EXTRA="-march=native -D _FORTIFY_SOURCE=2 -D DEFAULT_VDB -D TEST_WITH_SYSTEM_MALLOC" - - CONF_OPTIONS="--without-libatomic-ops --enable-cplusplus --disable-handle-fork" - - addons: - apt: - packages: - - libatomic-ops-dev - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2 -D TEST_PAGES_EXECUTABLE" - - CONF_OPTIONS="--with-libatomic-ops=yes --enable-gc-assertions --enable-cplusplus --disable-throw-bad-alloc-library" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CFLAGS_EXTRA="-march=native -D _FORTIFY_SOURCE=2 -D AO_DISABLE_GCC_ATOMICS" - - CONF_OPTIONS="--without-libatomic-ops --enable-munmap --enable-cplusplus --enable-static" - - compiler: gcc - env: - - CONF_CFLAGS="-O3 -D _FORTIFY_SOURCE=2 -D AO_USE_PTHREAD_DEFS -D RANDOM_ONE_CPU_CORE" - - CONF_OPTIONS="--without-libatomic-ops --enable-gc-assertions --enable-cplusplus --enable-static" - - compiler: clang - env: - - CONF_CFLAGS="-D AO_USE_PTHREAD_DEFS" - - CONF_OPTIONS="--without-libatomic-ops" - - addons: - apt: - packages: - - libatomic-ops-dev - compiler: gcc - env: - - CONF_CFLAGS="-O3 -D AO_USE_PTHREAD_DEFS -D RANDOM_ONE_CPU_CORE" - - CONF_OPTIONS="--with-libatomic-ops=yes --enable-cplusplus" - - CFLAGS_EXTRA="-D GC_NO_FINALIZATION" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - libatomic-ops-dev - compiler: clang - env: - - CONF_CFLAGS="-O3 -D AO_USE_PTHREAD_DEFS -D RANDOM_ONE_CPU_CORE" - - CONF_OPTIONS="--with-libatomic-ops=yes --enable-gc-assertions --enable-cplusplus --disable-shared --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-funsigned-char -D _FORTIFY_SOURCE=2 -D DONT_ADD_BYTE_AT_END -D GC_TIME_LIMIT=3" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus" - - addons: - apt: - packages: - - gcc-multilib - compiler: gcc - env: - - CFLAGS_EXTRA="-m32 -D _FORTIFY_SOURCE=2 -D MARK_BIT_PER_OBJ -D USE_CUSTOM_SPECIFIC" - - CONF_OPTIONS="--enable-gc-assertions" - - compiler: clang - env: - - CFLAGS_EXTRA="-D MARK_BIT_PER_OBJ" - - CONF_OPTIONS="--enable-cplusplus --enable-rwlock --disable-shared" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2 -D NO_CLOCK -D POINTER_MASK=~0xf" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-handle-fork=manual" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D PROC_VDB -D GC_NO_SYS_FAULT_H -D NO_INCREMENTAL -D DEBUG_DIRTY_BITS" - - CONF_OPTIONS="--enable-cplusplus --disable-docs" - - compiler: clang - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2 -D TEST_MANUAL_VDB" - - CONF_OPTIONS="--enable-gc-assertions --disable-parallel-mark" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D TEST_MANUAL_VDB" - - CONF_OPTIONS="--enable-gc-assertions --disable-munmap" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2 -D FIND_LEAK -D SKIP_LEAKED_OBJECTS_PRINTING" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus" - - compiler: gcc - env: - - CFLAGS_EXTRA="-D SMALL_CONFIG -D NO_GETENV" - - CONF_OPTIONS="--enable-cplusplus" - - compiler: gcc - env: - - CFLAGS_EXTRA="-std=c11 -D _FORTIFY_SOURCE=2 -D GC_NO_SIGSETJMP" - - CONF_OPTIONS="--disable-threads --enable-gc-assertions" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CONF_OPTIONS="--disable-thread-local-alloc --enable-cplusplus --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -flto -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--disable-parallel-mark --disable-thread-local-alloc --enable-gc-assertions --enable-cplusplus" - - compiler: gcc - env: - - CONF_OPTIONS="--enable-gc-debug --enable-cplusplus" - - compiler: gcc - env: - - CONF_OPTIONS="--disable-gc-debug --enable-cplusplus" - - compiler: clang - env: - - CONF_OPTIONS="--enable-large-config --enable-cplusplus --disable-shared --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CFLAGS_EXTRA="-D TEST_HANDLE_FORK" - - CONF_OPTIONS="--enable-cplusplus --disable-shared --enable-rwlock --enable-static" - - os: osx - env: - - CONF_OPTIONS="--enable-large-config --enable-cplusplus --disable-handle-fork" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: gcc - env: - - CONF_OPTIONS="--enable-large-config --disable-munmap" - - CFLAGS_EXTRA="-m32" - - compiler: gcc - env: - - CONF_OPTIONS="--enable-large-config --enable-cplusplus --enable-gc-assertions --enable-static" - - CFLAGS_EXTRA="-D LINT2 -D NO_VDB_FOR_STATIC_ROOTS -D TEST_REUSE_SIG_SUSPEND" - - compiler: gcc - env: - - CONF_OPTIONS="--enable-large-config --enable-redirect-malloc --disable-threads" - - CFLAGS_EXTRA="-O3" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: clang - env: - - CONF_OPTIONS="--enable-redirect-malloc --enable-static --disable-threads" - - CFLAGS_EXTRA="-m32" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CONF_OPTIONS="--enable-redirect-malloc --enable-cplusplus --enable-static --disable-threads" - - CFLAGS_EXTRA="-m32" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-redirect-malloc --enable-gc-debug --enable-cplusplus --enable-gc-assertions" - - compiler: clang - env: - - CONF_OPTIONS="--disable-threads --enable-cplusplus" - - CFLAGS_EXTRA="-O3 -march=native" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--disable-static --disable-threads --enable-cplusplus" - - CFLAGS_EXTRA="-O3 -march=native -D GC_PREFER_MPROTECT_VDB" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CONF_OPTIONS="--disable-threads --enable-cplusplus" - - CFLAGS_EXTRA="-O3 -march=native" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CMAKE_OPTIONS="-Denable_cplusplus=ON -Denable_gc_assertions=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - libatomic-ops-dev - compiler: clang - env: - - CMAKE_OPTIONS="-Denable_cplusplus=ON -Denable_munmap=OFF -Dwith_libatomic_ops=ON" - - compiler: gcc - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON -Denable_large_config=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -Denable_gc_debug=ON -Dwithout_libatomic_ops=ON" - - compiler: gcc - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -Denable_threads=OFF" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CMAKE_BUILD_OPTIONS="--verbose" - - CMAKE_OPTIONS="-Denable_cplusplus=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CMAKE_BUILD_OPTIONS="--verbose" - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -Denable_cplusplus=ON -Denable_gc_assertions=ON -Denable_large_config=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - compiler: gcc - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - os: osx - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - addons: - apt: - packages: - - musl-tools - compiler: musl-gcc - language: c - env: - - CONF_OPTIONS="--disable-parallel-mark --enable-gc-assertions" - - compiler: clang - dist: xenial - env: - - CFLAGS_EXTRA="-fsanitize=address -fno-common -fno-omit-frame-pointer" - - CONF_OPTIONS="--enable-cplusplus --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - TESTS_CUSTOM_RUN=true - - addons: - apt: - packages: - - gcc-5 - sources: - - ubuntu-toolchain-r-test - compiler: gcc-5 - dist: xenial - language: c - env: - - CFLAGS_EXTRA="-fsanitize=address -O0" - - CONF_OPTIONS="--enable-gc-assertions" - - LDFLAGS="-fuse-ld=gold" - - os: osx - env: - - CFLAGS_EXTRA="-fsanitize=address -m32 -fno-omit-frame-pointer" - - CONF_OPTIONS="--disable-shared --enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - language: c - env: - - CFLAGS_EXTRA="-fsanitize=memory -fno-omit-frame-pointer -std=gnu11" - - CONF_OPTIONS="--enable-static" - - TESTS_CUSTOM_RUN=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CFLAGS_EXTRA="-fsanitize=undefined -fno-common -fno-omit-frame-pointer" - - TESTS_CUSTOM_RUN=true - - CONF_OPTIONS="--enable-cplusplus --enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-fsanitize=thread -fno-omit-frame-pointer" - - CONF_OPTIONS="--enable-gc-assertions" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - clang-12 - compiler: clang-12 - dist: focal - language: c - env: - - CFLAGS_EXTRA="-O3 -fsanitize=thread -fno-omit-frame-pointer" - - CONF_OPTIONS="--enable-static" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - dist: focal - env: - - CFLAGS_EXTRA="-fsanitize=thread -D NO_INCREMENTAL -fno-omit-frame-pointer -D TEST_FORK_WITHOUT_ATFORK" - - CONF_OPTIONS="--enable-gc-assertions --enable-gc-debug --enable-handle-fork=manual --enable-large-config --without-libatomic-ops" - - compiler: clang - env: - - CFLAGS_EXTRA="-fsanitize=thread -D NO_INCREMENTAL -fno-omit-frame-pointer -D NTHREADS=0" - - CONF_OPTIONS="--disable-parallel-mark --disable-thread-local-alloc --disable-shared --enable-gc-assertions --without-libatomic-ops" - - compiler: clang - env: - - CFLAGS_EXTRA="-O3 -march=native -D NTHREADS=10" - - CONF_OPTIONS="--enable-cplusplus --enable-static --enable-single-obj-compilation" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: clang - env: - - CFLAGS_EXTRA="-m32 -D _FORTIFY_SOURCE=2 -D GC_DISABLE_INCREMENTAL -std=gnu11" - - CONF_OPTIONS="--enable-gc-assertions --enable-gc-debug" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--enable-cplusplus --enable-gc-assertions --enable-static" - - CFLAGS_EXTRA="-D VERY_SMALL_CONFIG" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: gcc - env: - - CFLAGS_EXTRA="-m32 -O3 -std=gnu11" - - CONF_OPTIONS="--disable-shared --enable-static --enable-single-obj-compilation" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-8 - - gcc-8-multilib - - gcc-multilib - compiler: gcc-8 - dist: focal - language: c - env: - - CFLAGS_EXTRA="-mx32 -march=native -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-large-config --enable-gc-assertions" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CFLAGS_EXTRA="-x c++" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-gc-debug --disable-shared" - - MAKEFILE_TARGETS="all" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CC_FOR_CHECK=g++ - - CONF_OPTIONS="--enable-gc-assertions" - - MAKEFILE_TARGETS="all" - - MAKEFILE_TARGETS_CHECK="check" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CFLAGS_EXTRA="-O3 -Wall -Wextra -Werror -x c++" - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="cords" - - compiler: gcc - env: - - CC_FOR_CHECK=g++ - - CFLAGS_EXTRA="-O3 -Wall -Wextra -Werror -D TEST_MANUAL_VDB" - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="cords" - - MAKEFILE_TARGETS_CHECK="cord/de check" - - addons: - apt: - packages: - - g++-mingw-w64 - - gcc-mingw-w64 - compiler: x86_64-w64-mingw32-gcc - language: c - env: - - CXX=x86_64-w64-mingw32-g++ - - CONF_OPTIONS="--host=x86_64-w64-mingw32 --enable-cplusplus --disable-shared" - - MAKEFILE_TARGETS="all" - - addons: - apt: - packages: - - gcc-mingw-w64 - compiler: x86_64-w64-mingw32-gcc - language: c - env: - - CONF_OPTIONS="--host=x86_64-w64-mingw32 --enable-gc-assertions --enable-gc-debug --enable-threads=pthreads" - - MAKEFILE_TARGETS="all" - - addons: - apt: - packages: - - gcc-mingw-w64 - compiler: i686-w64-mingw32-gcc - language: c - env: - - CONF_OPTIONS="--host=i686-w64-mingw32" - - MAKEFILE_TARGETS="all" - - CFLAGS_EXTRA="-fno-omit-frame-pointer" - - dist: focal - env: - - MAKEFILE_TARGETS="distcheck" - - AUTOCONF_VER=2.71 - - AUTOMAKE_VER=1.16.5 - - LIBTOOL_VER=2.4.7 - - M4_VER=1.4.19 - - NO_CLONE_LIBATOMIC_OPS=true - -before_install: -- if [[ "$CPPCHECK_ENABLE" != "" ]]; then - CPPCHECK_VER=2.4.1; - 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 [[ "$AUTOCONF_VER" != "" || "$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 && 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 [[ "$AUTOCONF_VER" != "" ]]; then - AUTOCONF_XZ_URL=$GNU_DOWNLOAD_SITE/autoconf/autoconf-$AUTOCONF_VER.tar.xz; - wget -O - $AUTOCONF_XZ_URL | tar xf - --xz --directory ~; - (cd ~/autoconf-$AUTOCONF_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_TARGETS" == *"dist"* ]]; then - autoconf --version; - automake --version; - m4 --version; - libtool --version || true; - fi -- if [[ "$CMAKE_OPTIONS" != "" ]]; then - cmake --version; - fi -- if [[ "$CONF_CFLAGS" == "" ]]; then CONF_CFLAGS="-g -O2"; fi -- if [[ "$MAKEFILE_NAME" == "" ]]; then MAKEFILE_NAME=Makefile; fi -- if [[ "$MAKEFILE_TARGETS" == "" ]]; then MAKEFILE_TARGETS="check"; fi - -install: -- if [[ "$NO_CLONE_LIBATOMIC_OPS" != true ]]; then - git clone --depth=50 https://github.com/ivmai/libatomic_ops.git; - fi -- if [[ "$CMAKE_OPTIONS" == "" ]]; then - ./autogen.sh; - fi -- if [[ "$GNUTOOLS_ROOT" != "" ]]; then mv $GNUTOOLS_ROOT $GNUTOOLS_ROOT-x; fi -- if [[ "$REPORT_COVERAGE" == true ]]; then gem install coveralls-lcov; fi - -script: -- if [[ "$CSA_CHECK" != true && "$CMAKE_OPTIONS" == "" - && "$CPPCHECK_ENABLE" == "" && "$MAKEFILE_NAME" != "Makefile.direct" - && "$COVERITY_SCAN_BRANCH" != 1 ]]; then - CFLAGS="$CONF_CFLAGS" ./configure $CONF_OPTIONS --enable-werror && - cat include/config.h; - fi -- if [[ "$CSA_CHECK" != true && "$CMAKE_OPTIONS" == "" - && "$CPPCHECK_ENABLE" == "" && "$COVERITY_SCAN_BRANCH" != 1 ]]; then - make -j$MAKE_NPROC -f $MAKEFILE_NAME $MAKEFILE_TARGETS - CFLAGS_EXTRA="$CFLAGS_EXTRA" LDFLAGS="$LDFLAGS"; - fi -- if [[ "$CMAKE_OPTIONS" != "" ]]; then - cmake $CMAKE_OPTIONS -Dbuild_tests=ON -Denable_werror=ON -Werror=dev . - && cmake --build . $CMAKE_BUILD_OPTIONS; - fi -- if [[ "$CMAKE_OPTIONS" != "" ]]; then - ctest -j4 -V; - fi -- if [[ "$CC_FOR_CHECK" != "" ]]; then - make -f $MAKEFILE_NAME $MAKEFILE_TARGETS_CHECK CC=$CC_FOR_CHECK - CFLAGS_EXTRA="$CFLAGS_EXTRA"; - fi -- if [ -f cordtest.log ]; then cat cordtest.log; fi -- if [ -f disclaim_bench.log ]; then cat disclaim_bench.log; fi -- if [ -f disclaimtest.log ]; then cat disclaimtest.log; fi -- if [ -f gctest.log ]; then cat gctest.log; fi -- if [ -f threadkeytest.log ]; then cat threadkeytest.log; fi -- if [ -f threadleaktest.log ]; then cat threadleaktest.log; fi -- if [ -f weakmaptest.log ]; then cat weakmaptest.log; fi -- if [[ "$CSA_CHECK" == true ]]; then - set -o pipefail; ${CC} --analyze -Xanalyzer -analyzer-output=text -Werror - -I include -I libatomic_ops/src $CFLAGS_EXTRA - *.c *.cc cord/*.c cord/tests/cordtest.c cord/tests/de.c extra/gc.c - extra/msvc_dbg.c extra/pcr_interface.c extra/real_malloc.c - tests/*.c tests/*.cc tools/*.c 2>&1 | tee clang-analyzer-output.log; - if [ -s clang-analyzer-output.log ]; then exit 1; fi; - fi -- if [[ "$CPPCHECK_ENABLE" != "" ]]; then - if [[ "$CPPCHECK_OUT_FILTER" == "" ]]; then CPPCHECK_OUT_FILTER="c "; fi; - set -o pipefail; ~/cppcheck/cppcheck --error-exitcode=2 - -U CORD_API -U GC_API -D CPPCHECK -I include $CPPCHECK_ENABLE | - grep --line-buffered "$CPPCHECK_OUT_FILTER"; - fi -- if [[ "$TESTS_CUSTOM_RUN" == true ]]; then - ASAN_OPTIONS="detect_leaks=1" UBSAN_OPTIONS="halt_on_error=1" - make check-without-test-driver; - fi - -after_success: -- if [[ "$REPORT_COVERAGE" == true ]]; then - lcov --capture --base-directory . --directory . --output-file coverage.info; - lcov --remove coverage.info '/usr/*' 'cord/tests/*' 'libatomic_ops/*' '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: gc-*.tar.gz - file_glob: true - on: - condition: $MAKEFILE_TARGETS = distcheck - repo: ivmai/bdwgc - tags: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 214665994..982fbd0f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,9 +152,6 @@ if (BORLAND) elseif (MSVC) # All warnings but ignoring "conditional expression is constant" one. add_compile_options(/W4 /wd4127) - # Disable crt security warnings, since unfortunately they warn about all - # sorts of safe uses of strncpy. - add_definitions("-D_CRT_SECURE_NO_DEPRECATE") elseif (WATCOM) add_compile_options(/wx) if (NOT enable_threads) @@ -166,6 +163,11 @@ else() add_compile_options(-Wall -Wextra) endif() +if (WIN32) + # Disable MS crt security warnings reported e.g. for getenv, strcpy. + add_definitions("-D_CRT_SECURE_NO_DEPRECATE") +endif() + include_directories(include) set(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c @@ -228,7 +230,7 @@ if (enable_threads) # Thread support detection. if (CMAKE_USE_PTHREADS_INIT) set(SRC ${SRC} gc_dlopen.c pthread_start.c pthread_support.c) - if (CYGWIN OR MSYS) + if (CYGWIN OR MINGW OR MSYS) set(SRC ${SRC} win32_threads.c) else() if (APPLE) @@ -261,7 +263,7 @@ if (enable_threads) elseif (CMAKE_C_COMPILER_ID STREQUAL "SunPro") set(NEED_LIB_RT ON) endif() - if (MSYS) + if (MINGW OR MSYS) # Does not provide process fork functionality. elseif (APPLE) # The incremental mode conflicts with fork handling (for now). @@ -365,6 +367,9 @@ if (enable_redirect_malloc) add_definitions("-DREDIRECT_MALLOC=GC_malloc") endif() add_definitions("-DGC_USE_DLOPEN_WRAP") + if (WIN32) + add_definitions("-DREDIRECT_MALLOC_IN_HEADER") + endif(WIN32) endif(enable_redirect_malloc) if (enable_munmap) @@ -434,7 +439,7 @@ endif(enable_werror) if (enable_single_obj_compilation OR (BUILD_SHARED_LIBS AND NOT disable_single_obj_compilation)) set(SRC extra/gc.c) # override SRC - if (enable_threads AND CMAKE_USE_PTHREADS_INIT AND NOT (APPLE OR CYGWIN OR MSYS)) + if (enable_threads AND CMAKE_USE_PTHREADS_INIT AND NOT (APPLE OR CYGWIN OR MINGW OR MSYS)) add_definitions("-DGC_PTHREAD_START_STANDALONE") set(SRC ${SRC} pthread_start.c) endif() @@ -566,7 +571,7 @@ endif() # Check for pthread_sigmask and sigset_t. if (enable_threads AND CMAKE_USE_PTHREADS_INIT) - if (NOT (APPLE OR CYGWIN OR MSYS)) + if (NOT (APPLE OR CYGWIN OR MINGW OR MSYS)) check_c_source_compiles(" #define _GNU_SOURCE 1\n #include \n @@ -829,7 +834,7 @@ if (build_tests) target_link_libraries(cordtest PRIVATE cord gc) add_test(NAME cordtest COMMAND cordtest) - if (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) # ?? and not MS clang add_executable(de cord/tests/de.c cord/tests/de_win.c cord/tests/de_win.rc ${NODIST_SRC}) set_target_properties(de PROPERTIES WIN32_EXECUTABLE TRUE) diff --git a/include/gc/gc.h b/include/gc/gc.h index 66f9dad53..c820b85f3 100644 --- a/include/gc/gc.h +++ b/include/gc/gc.h @@ -1878,7 +1878,7 @@ GC_API void GC_CALL GC_dump_finalization(void); /* Even then, these are probably more useful as */ /* documentation than as part of the API. */ /* Note that GC_PTR_ADD evaluates the first argument more than once. */ -#if defined(GC_DEBUG) && defined(__GNUC__) +#if defined(GC_DEBUG) && (defined(__GNUC__) || defined(__clang__)) # define GC_PTR_ADD3(x, n, type_of_result) \ ((type_of_result)GC_same_obj((x)+(n), (x))) # define GC_PRE_INCR3(x, n, type_of_result) \ diff --git a/include/gc/gc_inline.h b/include/gc/gc_inline.h index 323a37c42..723289d95 100644 --- a/include/gc/gc_inline.h +++ b/include/gc/gc_inline.h @@ -34,7 +34,7 @@ #include "gc.h" #include "gc_tiny_fl.h" -#if GC_GNUC_PREREQ(3, 0) +#if GC_GNUC_PREREQ(3, 0) || defined(__clang__) # define GC_EXPECT(expr, outcome) __builtin_expect(expr, outcome) /* Equivalent to (expr), but predict that usually (expr)==outcome. */ #else @@ -51,7 +51,8 @@ #endif #ifndef GC_PREFETCH_FOR_WRITE -# if GC_GNUC_PREREQ(3, 0) && !defined(GC_NO_PREFETCH_FOR_WRITE) +# if (GC_GNUC_PREREQ(3, 0) || defined(__clang__)) \ + && !defined(GC_NO_PREFETCH_FOR_WRITE) # define GC_PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1 /* write */) # elif defined(_MSC_VER) && !defined(GC_NO_PREFETCH_FOR_WRITE) \ && (defined(_M_IX86) || defined(_M_X64)) && !defined(_CHPE_ONLY_) \ diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 5396217a7..142b2a24e 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -109,7 +109,7 @@ typedef int GC_bool; # define GC_SIZE_MAX (~(size_t)0) #endif -#if GC_GNUC_PREREQ(3, 0) && !defined(LINT2) +#if (GC_GNUC_PREREQ(3, 0) || defined(__clang__)) && !defined(LINT2) # define EXPECT(expr, outcome) __builtin_expect(expr,outcome) /* Equivalent to (expr), but predict that usually (expr)==outcome. */ #else @@ -2866,10 +2866,6 @@ GC_INNER void *GC_store_debug_info_inner(void *p, word sz, const char *str, void * GC_find_limit(void *, int); #endif -#ifdef UNIX_LIKE - GC_INNER void GC_set_and_save_fault_handler(void (*handler)(int)); -#endif - #ifdef NEED_PROC_MAPS # if defined(DYNAMIC_LOADING) && defined(USE_PROC_FOR_LIBRARIES) GC_INNER const char *GC_parse_map_entry(const char *maps_ptr, @@ -3057,8 +3053,16 @@ GC_INNER void *GC_store_debug_info_inner(void *p, word sz, const char *str, #endif /* DATASTART_USES_BSDGETDATASTART */ #if defined(NEED_FIND_LIMIT) \ - || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) \ - || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) + || (defined(UNIX_LIKE) && !defined(NO_DEBUGGING)) \ + || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) \ + || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) + typedef void (*GC_fault_handler_t)(int); + GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t); +#endif + +#if defined(NEED_FIND_LIMIT) \ + || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) \ + || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) GC_EXTERN JMP_BUF GC_jmp_buf; /* Set up a handler for address faults which will longjmp to */ diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 4683a1090..f2ec1f2d5 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -2659,7 +2659,8 @@ EXTERN_C_BEGIN #endif #if !defined(NO_MARKER_SPECIAL_SIGMASK) \ - && (defined(NACL) || defined(GC_WIN32_PTHREADS)) + && (defined(NACL) || defined(GC_WIN32_PTHREADS) \ + || defined(GC_NO_PTHREAD_SIGMASK)) /* Either there is no pthread_sigmask(), or GC marker thread cannot */ /* steal and drop user signal calls. */ # define NO_MARKER_SPECIAL_SIGMASK @@ -2889,7 +2890,7 @@ EXTERN_C_BEGIN #endif #ifndef PREFETCH -# if GC_GNUC_PREREQ(3, 0) && !defined(NO_PREFETCH) +# if (GC_GNUC_PREREQ(3, 0) || defined(__clang__)) && !defined(NO_PREFETCH) # define PREFETCH(x) __builtin_prefetch((x), 0, 0) # elif defined(_MSC_VER) && !defined(NO_PREFETCH) \ && (defined(_M_IX86) || defined(_M_X64)) && !defined(_CHPE_ONLY_) \ @@ -3216,8 +3217,8 @@ EXTERN_C_BEGIN #endif #if !defined(CAN_HANDLE_FORK) && !defined(NO_HANDLE_FORK) \ - && !defined(HAVE_NO_FORK) \ - && ((defined(GC_PTHREADS) && !defined(NACL) \ + && !defined(HAVE_NO_FORK) && defined(GC_PTHREADS) \ + && ((!defined(NACL) \ && !defined(GC_WIN32_PTHREADS) && !defined(USE_WINALLOC)) \ || (defined(DARWIN) && defined(MPROTECT_VDB)) || defined(HANDLE_FORK)) /* Attempts (where supported and requested) to make GC_malloc work in */ diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h index c7569b4e7..aa8405d6c 100644 --- a/include/private/pthread_support.h +++ b/include/private/pthread_support.h @@ -319,7 +319,8 @@ GC_EXTERN GC_on_thread_event_proc GC_on_thread_event; # ifndef GC_PTHREADS_PARAMARK GC_EXTERN thread_id_t GC_marker_Id[MAX_MARKERS - 1]; # endif -# if !defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) && !defined(MSWINCE) +# if (!defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) || !defined(GC_PTHREADS)) \ + && !defined(MSWINCE) GC_INNER void GC_init_win32_thread_naming(HMODULE hK32); # endif # ifdef GC_PTHREADS_PARAMARK @@ -396,7 +397,8 @@ GC_INNER void GC_wait_for_gc_completion(GC_bool); GC_INNER void GC_nacl_shutdown_gc_thread(void); #endif -#ifdef GC_EXPLICIT_SIGNALS_UNBLOCK +#if defined(PTHREAD_STOP_WORLD_IMPL) && !defined(NO_SIGNALS_UNBLOCK_IN_MAIN) \ + || defined(GC_EXPLICIT_SIGNALS_UNBLOCK) GC_INNER void GC_unblock_gc_signals(void); #endif diff --git a/os_dep.c b/os_dep.c index 3c15808fd..7d6a33be2 100644 --- a/os_dep.c +++ b/os_dep.c @@ -862,17 +862,17 @@ GC_INNER void GC_setpagesize(void) # define HAVE_GET_STACK_BASE #endif /* OS2 */ -# ifdef AMIGA +#ifdef AMIGA # define GC_AMIGA_SB # include "extra/AmigaOS.c" # undef GC_AMIGA_SB # define GET_MAIN_STACKBASE_SPECIAL -# endif /* AMIGA */ - -# if defined(NEED_FIND_LIMIT) || defined(UNIX_LIKE) \ - || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) +#endif /* AMIGA */ - typedef void (*GC_fault_handler_t)(int); +#if defined(NEED_FIND_LIMIT) \ + || (defined(UNIX_LIKE) && !defined(NO_DEBUGGING)) \ + || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) \ + || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) # ifdef USE_SEGV_SIGACT # ifndef OPENBSD @@ -927,11 +927,11 @@ GC_INNER void GC_setpagesize(void) GC_noop1((word)&__asan_default_options); # endif } -# endif /* NEED_FIND_LIMIT || UNIX_LIKE */ +#endif /* NEED_FIND_LIMIT || UNIX_LIKE || WRAP_MARK_SOME */ -# if defined(NEED_FIND_LIMIT) \ - || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) \ - || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) +#if defined(NEED_FIND_LIMIT) \ + || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) \ + || (defined(WRAP_MARK_SOME) && defined(NO_SEH_AVAILABLE)) GC_INNER JMP_BUF GC_jmp_buf; STATIC void GC_fault_handler(int sig) @@ -962,9 +962,9 @@ GC_INNER void GC_setpagesize(void) # endif # endif } -# endif /* NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES || WRAP_MARK_SOME */ +#endif /* NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES || WRAP_MARK_SOME */ -# if defined(NEED_FIND_LIMIT) \ +#if defined(NEED_FIND_LIMIT) \ || (defined(USE_PROC_FOR_LIBRARIES) && defined(THREADS)) # define MIN_PAGE_SIZE 256 /* Smallest conceivable page size, in bytes. */ @@ -1020,7 +1020,7 @@ GC_INNER void GC_setpagesize(void) return GC_find_limit_with_bound((ptr_t)p, (GC_bool)up, up ? (ptr_t)GC_WORD_MAX : 0); } -# endif /* NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES */ +#endif /* NEED_FIND_LIMIT || USE_PROC_FOR_LIBRARIES */ #ifdef HPUX_MAIN_STACKBOTTOM # include diff --git a/pthread_stop_world.c b/pthread_stop_world.c index c7ff50b2b..3b10df7a4 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -74,10 +74,10 @@ GC_INLINE void GC_usleep(unsigned us) # error please define AO_REQUIRE_CAS manually #endif -/* It's safe to call original pthread_sigmask() here. */ -#undef pthread_sigmask - #ifdef DEBUG_THREADS + /* It's safe to call original pthread_sigmask() here. */ +# undef pthread_sigmask + # ifndef NSIG # ifdef CPPCHECK # define NSIG 32 @@ -213,23 +213,6 @@ GC_API int GC_CALL GC_get_thr_restart_signal(void) ? GC_sig_thr_restart : SIG_THR_RESTART; } -#if defined(GC_EXPLICIT_SIGNALS_UNBLOCK) \ - || !defined(NO_SIGNALS_UNBLOCK_IN_MAIN) - /* Some targets (e.g., Solaris) might require this to be called when */ - /* doing thread registering from the thread destructor. */ - GC_INNER void GC_unblock_gc_signals(void) - { - sigset_t set; - sigemptyset(&set); - GC_ASSERT(GC_sig_suspend != SIGNAL_UNSET); - GC_ASSERT(GC_sig_thr_restart != SIGNAL_UNSET); - sigaddset(&set, GC_sig_suspend); - sigaddset(&set, GC_sig_thr_restart); - if (pthread_sigmask(SIG_UNBLOCK, &set, NULL) != 0) - ABORT("pthread_sigmask failed"); - } -#endif /* GC_EXPLICIT_SIGNALS_UNBLOCK */ - #ifdef BASE_ATOMIC_OPS_EMULATED /* The AO primitives emulated with locks cannot be used inside signal */ /* handlers as this could cause a deadlock or a double lock. */ diff --git a/pthread_support.c b/pthread_support.c index ee38162ca..3b9bd1f9a 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -352,9 +352,9 @@ (signed_word)err); } -# elif defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) \ - || defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) \ - || defined(HAVE_PTHREAD_SET_NAME_NP) +# elif (defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) \ + || defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) \ + || defined(HAVE_PTHREAD_SET_NAME_NP)) && defined(GC_PTHREADS) # ifdef HAVE_PTHREAD_SET_NAME_NP # include # endif @@ -2230,6 +2230,22 @@ GC_API void GC_CALL GC_allow_register_threads(void) set_need_to_lock(); } +#if defined(PTHREAD_STOP_WORLD_IMPL) && !defined(NO_SIGNALS_UNBLOCK_IN_MAIN) \ + || defined(GC_EXPLICIT_SIGNALS_UNBLOCK) + /* Some targets (e.g., Solaris) might require this to be called when */ + /* doing thread registering from the thread destructor. */ + GC_INNER void GC_unblock_gc_signals(void) + { + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, GC_get_suspend_signal()); + sigaddset(&set, GC_get_thr_restart_signal()); + if (REAL_FUNC(pthread_sigmask)(SIG_UNBLOCK, &set, NULL) != 0) + ABORT("pthread_sigmask failed"); + } +#endif /* PTHREAD_STOP_WORLD_IMPL || GC_EXPLICIT_SIGNALS_UNBLOCK */ + GC_API int GC_CALL GC_register_my_thread(const struct GC_stack_base *sb) { GC_thread me; diff --git a/win32_threads.c b/win32_threads.c index 9c34e5e30..c9e2460cc 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1645,8 +1645,9 @@ GC_INNER void GC_thr_init(void) { struct GC_stack_base sb; thread_id_t self_id = GetCurrentThreadId(); -# if (!defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) && !defined(MSWINCE) \ - && defined(PARALLEL_MARK)) || defined(WOW64_THREAD_CONTEXT_WORKAROUND) +# if ((!defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) || !defined(GC_PTHREADS)) \ + && !defined(MSWINCE) && defined(PARALLEL_MARK)) \ + || defined(WOW64_THREAD_CONTEXT_WORKAROUND) HMODULE hK32; # ifdef MSWINRT_FLAVOR MEMORY_BASIC_INFORMATION memInfo; @@ -1759,7 +1760,8 @@ GC_INNER void GC_thr_init(void) || mark_cv == (HANDLE)0) ABORT("CreateEvent failed"); # endif -# if !defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) && !defined(MSWINCE) +# if (!defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) \ + || !defined(GC_PTHREADS)) && !defined(MSWINCE) GC_init_win32_thread_naming(hK32); # endif }