diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 02e64bb8e..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,236 +0,0 @@ -version: 8.3.0-{build} - -image: -- Visual Studio 2022 - -environment: - STUDIO_VERSION_EDITION: Studio\2022\Community - MINGW_FOLDER: mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32 - DJGPP_VER: 3.4 - DJGPP_GCC_VER: 1220 - DMC_VER: 857 - WATCOM_VER: 2024-12-02 - 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: -Dbuild_tests=ON -Denable_gc_assertions=ON -Denable_thread_local_alloc=OFF -Ddisable_single_obj_compilation=ON - - TARGET: cmake - CFLAGS_EXTRA: -DGC_DISABLE_INCREMENTAL - CMAKE_OPTIONS: -Dbuild_tests=ON -Denable_gc_assertions=ON -Denable_gcj_support=OFF -Denable_parallel_mark=OFF -Denable_thread_local_alloc=OFF -Denable_valgrind_tracking=ON - - TARGET: cmake - CMAKE_OPTIONS: -A Win32 -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON -Denable_large_config=ON - - TARGET: cmake - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -A ARM64 -DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON - - TARGET: cmake-bcc - CFLAGS_EXTRA: -DCONSOLE_LOG - CMAKE_OPTIONS: -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON - - TARGET: cmake-bcc - CFLAGS_EXTRA: -DCONSOLE_LOG -DNO_GWW_VDB - CMAKE_OPTIONS: -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON -Denable_gc_debug=ON -Denable_large_config=ON -Denable_threads=OFF - - TARGET: cmake-bcc - CFLAGS_EXTRA: -DCONSOLE_LOG - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON - - TARGET: cmake-mingw - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_cplusplus=ON - - TARGET: cmake-msys - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON -Dinstall_headers=OFF -Denable_rwlock=ON - - TARGET: cmake-msys - CMAKE_OPTIONS: -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_docs=OFF - - TARGET: cmake-msys - CMAKE_OPTIONS: -Dbuild_cord=OFF -Dbuild_tests=ON -Denable_atomic_uncollectable=OFF -Denable_disclaim=OFF -Denable_threads=OFF - - TARGET: cmake-wcc-nt - CFLAGS_EXTRA: -DCONSOLE_LOG - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_threads=OFF - - TARGET: cmake-wcc-nt - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_checksums=ON -Denable_dynamic_loading=OFF -Denable_large_config=ON -Denable_munmap=OFF -Denable_threads=OFF - - TARGET: cmake-wcc-nt - CFLAGS_EXTRA: -DCONSOLE_LOG -DNO_MSGBOX_ON_ERROR - CMAKE_CONFIG: Release - CMAKE_OPTIONS: -DBUILD_SHARED_LIBS=OFF -Dbuild_tests=ON -Denable_cplusplus=ON - - TARGET: cmake-wcc-nt - CFLAGS_EXTRA: -DCONSOLE_LOG -DNO_MSGBOX_ON_ERROR - CMAKE_OPTIONS: -DCMAKE_BUILD_TYPE=Debug -Dbuild_tests=ON -Denable_cplusplus=ON -Denable_gc_assertions=ON - - TARGET: nmake - ARCH: x86 - NMAKE_OPTIONS: enable_static=1 - - TARGET: nmake - ARCH: x64 - CFLAGS_EXTRA: /J /wd4391 - - TARGET: nmake - ARCH: x86 - CFLAGS_EXTRA: -DUSE_GLOBAL_ALLOC - 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 -DNO_MSGBOX_ON_ERROR - - 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: msys64-mingw64 - - TARGET: msys64-mingw64 - 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: msys64-mingw64 - 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: msys64-mingw64 - CFLAGS_EXTRA: -D NO_MSGBOX_ON_ERROR - - TARGET: msys64-mingw64 - 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: wcc - WCC_SYSTEM: DOS4GW - CFLAGS_EXTRA: -DSMALL_CONFIG - ENABLE_STATIC_OPT: "ENABLE_STATIC=1" - TEST_TARGET: check-deps - - 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 -zp1 -DFORCE_ALIGNMENT_ONE - WCC_INC_SUBDIR: nt - - TARGET: cygwin64 - CFLAGS_EXTRA: -std=c11 -D USE_WINALLOC -Wno-array-bounds - CONF_OPTIONS: --disable-threads - - TARGET: cygwin64 - CFLAGS_EXTRA: -D GCTEST_PRINT_VERBOSE -D DONT_PROTECT_PTRFREE -Wno-array-bounds - CONF_OPTIONS: --enable-cplusplus - - TARGET: cygwin64 - CFLAGS_EXTRA: -Wno-array-bounds - 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 -Wno-array-bounds - CONF_OPTIONS: --enable-cplusplus --enable-gc-assertions --enable-rwlock --disable-shared - - TARGET: cygwin64 - CFLAGS_EXTRA: -Wno-array-bounds - CONF_OPTIONS: --enable-cplusplus --enable-gc-debug - -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 --parallel ) -- cmd: if %TARGET%==cmake-mingw ( - set "path=C:\Program Files\CMake\bin;C:\%MINGW_FOLDER%\bin" - && mkdir out && cd out - && cmake -G "MinGW Makefiles" %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" .. - && cmake --build . --config %CMAKE_CONFIG% --verbose --parallel ) -- cmd: if %TARGET%==cmake-msys ( - set "path=C:\msys64\usr\bin;%path%" - && mkdir out && cd out - && cmake -G "MSYS Makefiles" %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" .. - && cmake --build . --config %CMAKE_CONFIG% --verbose --parallel ) -- cmd: if %TARGET%==nmake ( - "C:\Program Files\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%==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/v%DJGPP_VER%/djgpp-mingw-gcc%DJGPP_GCC_VER%-standalone.zip" - && 7z x -o.. djgpp-mingw-gcc%DJGPP_GCC_VER%-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/dm%DMC_VER%c.zip" - && 7z x -o.. dm%DMC_VER%c.zip > nul && set "path=%cd%\..\dm\bin;%path%" - && make -f digimars.mak CFLAGS_EXTRA="-wx %CFLAGS_EXTRA%" ) -- cmd: if %TARGET%==mingw-shared-no-make ( - set "path=C:\%MINGW_FOLDER%\bin;%path%" - && 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%==msys64-mingw64 ( - C:\msys64\usr\bin\bash -e -l -c - "cd /c/projects/bdwgc - && PATH=/c/msys64/mingw64/bin:$PATH 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/%WATCOM_VER%-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;%cd%\..\watcom\binnt" - && 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%" ) -- cmd: if %TARGET%==cmake-wcc-nt ( - appveyor DownloadFile "https://github.com/open-watcom/open-watcom-v2/releases/download/%WATCOM_VER%-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=C:\Program Files\CMake\bin;%cd%\..\watcom\binnt" - && set "include=%cd%\..\watcom\h\nt;%cd%\..\watcom\h" - && mkdir out && cd out - && cmake -G "Watcom WMake" %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" .. - && cmake --build . --config %CMAKE_CONFIG% --verbose ) -- cmd: if %TARGET%==cmake-bcc ( - appveyor DownloadFile "https://www.ivmaisoft.com/_bin/misc/freecommandLinetools.exe" - && 7z x -o..\Bcc55 freecommandLinetools.exe > nul - && set "path=C:\Program Files\CMake\bin;%cd%\..\Bcc55\Bin" - && echo -I"%cd%\..\Bcc55\Include" > %cd%\..\Bcc55\Bin\bcc32.cfg - && echo -L"%cd%\..\Bcc55\Lib;%cd%\..\Bcc55\Lib\PSDK" > %cd%\..\Bcc55\Bin\ilink32.cfg - && mkdir out && cd out - && cmake -G "Borland Makefiles" %CMAKE_OPTIONS% -Denable_werror=ON -DCFLAGS_EXTRA="%CFLAGS_EXTRA%" .. - && cmake --build . --config %CMAKE_CONFIG% --verbose --parallel ) - -test_script: -- cmd: if %TARGET%==cmake ( - ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 ) -- cmd: if %TARGET%==cmake-bcc ( - ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 ) -- cmd: if %TARGET%==cmake-mingw ( - ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 ) -- cmd: if %TARGET%==cmake-msys ( - ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 ) -- cmd: if %TARGET%==cmake-wcc-nt ( - ctest --build-config %CMAKE_CONFIG% --verbose --parallel 4 ) -- cmd: if %TARGET%==nmake ( - "C:\Program Files\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%==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 ( - 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-shared-no-make ( - 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%==msys64-mingw64 ( - C:\msys64\usr\bin\bash -e -l -c - "cd /c/projects/bdwgc - && PATH=/c/msys64/mingw64/bin:$PATH make -j -f Makefile.direct %TEST_TARGET% CC=gcc CURSES=-lgdi32 CFLAGS_EXTRA='-Werror -Wall -Wextra -Wpedantic %CFLAGS_EXTRA%'" ) -- cmd: if %TARGET%==wcc ( - set "beginlibpath=%cd%\..\watcom\binp\dll" - && 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/CodeQL.yml b/.github/workflows/CodeQL.yml deleted file mode 100644 index cd391eada..000000000 --- a/.github/workflows/CodeQL.yml +++ /dev/null @@ -1,35 +0,0 @@ -# CodeQL workflow for GitHub code scanning. -name: CodeQL - -on: [ push, pull_request ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'c-cpp' ] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml deleted file mode 100644 index d4568e6ce..000000000 --- a/.github/workflows/cmake-build.yml +++ /dev/null @@ -1,114 +0,0 @@ -# This workflow is for CMake-based build/test running on multiple platforms. -name: cmake build - -on: [push, pull_request] - -jobs: - build: - name: ${{ matrix.os }} ${{ matrix.c_compiler }} thr:${{ matrix.enable_threads }} rwlock:${{ matrix.enable_rwlock }} redir:${{ matrix.redirect_malloc }} dll:${{ matrix.shared_libs }} cpp:${{ matrix.enable_cplusplus }} - runs-on: ${{ matrix.os }} - timeout-minutes: 6 - - strategy: - # Deliver the feedback for all matrix combinations. - fail-fast: false - - matrix: - os: [ macos-latest, ubuntu-latest, windows-latest ] - c_compiler: [ cl, clang, gcc ] - cxx_compiler: [ cl, clang++, g++ ] - enable_cplusplus: [ off, on ] - build_type: [ Release ] - disable_gc_debug: [ off ] - gc_assertions: [ on ] - large_config: [ on ] - enable_threads: [ off, on ] - enable_rwlock: [ off, on ] - redirect_malloc: [ off, on ] - shared_libs: [ off, on ] - exclude: - - os: macos-latest - c_compiler: cl - - os: macos-latest - c_compiler: gcc - - os: ubuntu-latest - c_compiler: cl - - enable_threads: off - enable_rwlock: on - - c_compiler: cl - cxx_compiler: clang++ - - c_compiler: cl - cxx_compiler: g++ - - c_compiler: clang - cxx_compiler: cl - - c_compiler: clang - cxx_compiler: g++ - - c_compiler: gcc - cxx_compiler: cl - - c_compiler: gcc - cxx_compiler: clang++ - - os: macos-latest - enable_cplusplus: off - - os: ubuntu-latest - enable_cplusplus: off - - os: windows-latest - c_compiler: cl - enable_cplusplus: off - - os: windows-latest # TODO: replacement operator cannot be inline - c_compiler: clang - enable_cplusplus: on - - os: windows-latest - c_compiler: gcc - enable_cplusplus: off - - os: windows-latest # TODO: support dependency on libatomic_ops - c_compiler: cl - 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"' - - steps: - - uses: actions/checkout@v4 - - - name: Set reusable strings - # Turn repeated input strings into step outputs. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - ${{ matrix.cmake_generator_opt }} - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -Dbuild_tests=ON - -Ddisable_gc_debug=${{ matrix.disable_gc_debug }} - -Denable_cplusplus=${{ matrix.enable_cplusplus }} - -Denable_gc_assertions=${{ matrix.gc_assertions }} - -Denable_large_config=${{ matrix.large_config }} - -Denable_redirect_malloc=${{ matrix.redirect_malloc }} - -Denable_rwlock=${{ matrix.enable_rwlock }} - -Denable_threads=${{ matrix.enable_threads }} - -Denable_werror=ON - -Werror=dev - -S ${{ github.workspace }} - - - name: Build - # Build the code with the given configuration. - run: > - cmake --build ${{ steps.strings.outputs.build-output-dir }} - --config ${{ matrix.build_type }} --verbose --parallel - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. - run: ctest --build-config ${{ matrix.build_type }} --verbose --parallel 8 diff --git a/.github/workflows/cmake-cosmo.yml b/.github/workflows/cmake-cosmo.yml deleted file mode 100644 index cfaf32713..000000000 --- a/.github/workflows/cmake-cosmo.yml +++ /dev/null @@ -1,69 +0,0 @@ -# This workflow is for cmake-based build/test using Cosmo (Cosmopolitan). -name: cmake cosmo - -on: [push, pull_request] - -jobs: - build: - name: ${{ matrix.os }} thr:${{ matrix.enable_threads }} single-obj:${{ matrix.single_obj_compilation }} - runs-on: ${{ matrix.os }} - timeout-minutes: 4 - - strategy: - fail-fast: false - - matrix: - os: [ ubuntu-latest ] # TODO: macos-latest, windows-latest - enable_cplusplus: [ on ] - build_type: [ Debug ] - disable_gc_debug: [ off ] - gc_assertions: [ on ] - large_config: [ on ] - enable_threads: [ off ] # TODO: on - enable_rwlock: [ off ] - single_obj_compilation: [ off, on ] - redirect_malloc: [ off ] - - steps: - - uses: actions/checkout@v4 - - uses: bjia56/setup-cosmocc@main - with: - version: latest - - - name: Set reusable strings - # Turn repeated input strings into step outputs. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake targetting Cosmo - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - ${{ matrix.cmake_generator_opt }} - -DBUILD_SHARED_LIBS=OFF - -Denable_single_obj_compilation=${{ matrix.single_obj_compilation }} - -DCMAKE_C_COMPILER=cosmocc - -DCMAKE_CXX_COMPILER=cosmoc++ - -DCMAKE_AR=`type -p cosmoar` - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -Dbuild_tests=ON - -Ddisable_gc_debug=${{ matrix.disable_gc_debug }} - -Denable_cplusplus=${{ matrix.enable_cplusplus }} - -Denable_gc_assertions=${{ matrix.gc_assertions }} - -Denable_large_config=${{ matrix.large_config }} - -Denable_redirect_malloc=${{ matrix.redirect_malloc }} - -Denable_rwlock=${{ matrix.enable_rwlock }} - -Denable_threads=${{ matrix.enable_threads }} - -Denable_werror=ON - -Werror=dev - -S ${{ github.workspace }} - - - name: Build - run: > - cmake --build ${{ steps.strings.outputs.build-output-dir }} - --config ${{ matrix.build_type }} --verbose --parallel - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - run: ctest --build-config ${{ matrix.build_type }} --verbose --parallel 8 diff --git a/.github/workflows/zig-build.yml b/.github/workflows/zig-build.yml deleted file mode 100644 index 06caca1b8..000000000 --- a/.github/workflows/zig-build.yml +++ /dev/null @@ -1,117 +0,0 @@ -# This workflow is for zig-based build/test running on Linux, MacOS, Windows. -name: zig build - -on: [ push, pull_request ] - -jobs: - build: - name: ${{ matrix.os }} ${{ matrix.ttriple }} thr:${{ matrix.enable_threads }} rwlock:${{ matrix.enable_rwlock }} redir:${{ matrix.redirect_malloc }} gcdeb:${{ matrix.enable_gc_debug }} munmap:${{ matrix.enable_munmap }} paramark:${{ matrix.parallel_mark }} thrlocal:${{ matrix.thread_local_alloc }} dll:${{ matrix.shared_libs }} - runs-on: ${{ matrix.os }} - timeout-minutes: 7 - - strategy: - fail-fast: false - - matrix: - zig_version: [ "0.13.0" ] - os: [ macos-latest, ubuntu-latest, windows-latest ] - ttriple: [ native, native-native-msvc ] - enable_cplusplus: [ true ] - gc_assertions: [ true ] - large_config: [ false ] - enable_threads: [ false, true ] - disable_handle_fork: [ false ] - enable_rwlock: [ false, true ] - redirect_malloc: [ false, true ] - enable_gc_debug: [ false, true ] - enable_munmap: [ false, true ] - parallel_mark: [ false, true ] - thread_local_alloc: [ false, true ] - shared_libs: [ false, true ] - build_cord: [ false, true ] - exclude: - - build_cord: true # FIXME: cordtest hangs if shared lib build by MSVC - shared_libs: true - ttriple: native-native-msvc - - os: macos-latest - ttriple: native-native-msvc - - os: ubuntu-latest - ttriple: native-native-msvc - - os: windows-latest - disable_handle_fork: true - - enable_threads: false - disable_handle_fork: true - - enable_threads: false - parallel_mark: true - - enable_threads: false - enable_rwlock: true - - enable_threads: false - thread_local_alloc: true - # The following ones are long-running jobs, thus excluded. - - os: macos-latest - enable_gc_debug: true - enable_rwlock: true - # The following ones just to reduce amount of jobs. - - build_cord: false - shared_libs: false - - build_cord: false - ttriple: native - - enable_munmap: false - shared_libs: true - - enable_munmap: true - enable_threads: false - shared_libs: false - - enable_gc_debug: true - enable_rwlock: true - thread_local_alloc: false - - parallel_mark: false - redirect_malloc: true - - enable_gc_debug: true - thread_local_alloc: false - - os: macos-latest - enable_munmap: false - enable_threads: false - - os: macos-latest - enable_munmap: false - enable_rwlock: true - - os: macos-latest - enable_rwlock: true - thread_local_alloc: false - - os: macos-latest - enable_rwlock: true - parallel_mark: false - - os: macos-latest - enable_munmap: false - redirect_malloc: false - - os: macos-latest - enable_threads: true - redirect_malloc: false - thread_local_alloc: false - - os: macos-latest - enable_threads: true - parallel_mark: false - redirect_malloc: false - - steps: - - uses: actions/checkout@v4 - - uses: korandoru/setup-zig@v1 - with: - zig-version: ${{ matrix.zig_version }} - - name: Build - run: > - zig build -Dtarget=${{ matrix.ttriple }} - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} - -Dbuild_cord=${{ matrix.build_cord }} - -Ddisable_handle_fork=${{ matrix.disable_handle_fork }} - -Denable_cplusplus=${{ matrix.enable_cplusplus }} - -Denable_gc_assertions=${{ matrix.gc_assertions }} - -Denable_gc_debug=${{ matrix.enable_gc_debug }} - -Denable_large_config=${{ matrix.large_config }} - -Denable_munmap=${{ matrix.enable_munmap }} - -Denable_parallel_mark=${{ matrix.parallel_mark }} - -Denable_redirect_malloc=${{ matrix.redirect_malloc }} - -Denable_rwlock=${{ matrix.enable_rwlock }} - -Denable_thread_local_alloc=${{ matrix.thread_local_alloc }} - -Denable_threads=${{ matrix.enable_threads }} - -Denable_werror - test diff --git a/.github/workflows/zig-cross-compile.yml b/.github/workflows/zig-cross-compile.yml deleted file mode 100644 index aa8059174..000000000 --- a/.github/workflows/zig-cross-compile.yml +++ /dev/null @@ -1,157 +0,0 @@ -# This workflow uses Zig and its excellent cross-compilation support to test -# compiling for multiple platforms. No tests are actually run since it would -# require emulation. -name: zig cross-compile - -on: [ push, pull_request ] - -jobs: - build: - name: ${{ matrix.ttriple }} cpp:${{ matrix.enable_cplusplus }} thr:${{ matrix.enable_threads }} dll:${{ matrix.shared_libs }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - zig_version: [ "0.13.0" ] - # Some of the triples are commented out just to speedup this workflow. - ttriple: [ - aarch64-linux-gnu, - #aarch64-linux-musl, - aarch64-macos-none, - aarch64-windows-gnu, - #aarch64_be-linux-gnu, - aarch64_be-linux-musl, - #arm-linux-gnueabi, - arm-linux-gnueabihf, - arm-linux-musleabi, - #arm-linux-musleabihf, - armeb-linux-gnueabi, - #armeb-linux-gnueabihf, - #armeb-linux-musleabi, - armeb-linux-musleabihf, - #mips-linux-gnueabi, - #mips-linux-gnueabihf, - mips-linux-musl, - mips64-linux-gnuabi64, - #mips64-linux-gnuabin32, - mips64-linux-musl, - #mips64el-linux-gnuabi64, - mips64el-linux-gnuabin32, - mips64el-linux-musl, - mipsel-linux-gnueabi, - #mipsel-linux-gnueabihf, - mipsel-linux-musl, - #powerpc-linux-gnueabi, - powerpc-linux-gnueabihf, - #powerpc-linux-musl, - powerpc64-linux-gnu, - #powerpc64-linux-musl, - #powerpc64le-linux-gnu, - powerpc64le-linux-musl, - riscv64-linux-musl, - sparc64-linux-gnu, - thumb-linux-gnueabi, - #thumb-linux-gnueabihf, - #thumb-linux-musleabi, - thumb-linux-musleabihf, - wasm32-wasi-musl, - #x86-linux-gnu, - x86-linux-musl, - x86-windows-gnu, - x86_64-linux-gnu.2.27, # with a glibc version - x86_64-linux-gnux32, - #x86_64-linux-musl, - x86_64-macos-none, - x86_64-windows-gnu, - ] - enable_cplusplus: [ false, true ] - enable_threads: [ false, true ] - shared_libs: [ false, true ] - exclude: - - enable_threads: true - ttriple: wasm32-wasi-musl - - enable_cplusplus: false # excluded to speedup this workflow - shared_libs: false - # The following ones have "exceeds the max lock-free size" warning. - - enable_threads: true - ttriple: arm-linux-gnueabi - - enable_threads: true - ttriple: arm-linux-musleabi - - enable_threads: true - ttriple: armeb-linux-gnueabi - - enable_threads: true - ttriple: thumb-linux-gnueabi - - enable_threads: true - ttriple: thumb-linux-musleabi - - enable_threads: true - ttriple: thumb-linux-musleabihf - # The following ones have some zig link issue. - - shared_libs: true - ttriple: aarch64_be-linux-gnu - - shared_libs: true - ttriple: aarch64_be-linux-musl - - shared_libs: true - ttriple: armeb-linux-gnueabi - - shared_libs: true - ttriple: armeb-linux-gnueabihf - - shared_libs: true - ttriple: armeb-linux-musleabi - - shared_libs: true - ttriple: armeb-linux-musleabihf - - shared_libs: true - ttriple: mips64-linux-gnuabin32 - - shared_libs: true - ttriple: mips64el-linux-gnuabin32 - - shared_libs: true - ttriple: powerpc-linux-gnueabi - - shared_libs: true - ttriple: powerpc-linux-gnueabihf - - shared_libs: true - ttriple: sparc64-linux-gnu # FIXME: recompile with -fPIC - - shared_libs: true - ttriple: thumb-linux-gnueabi - - shared_libs: true - ttriple: thumb-linux-gnueabihf - - shared_libs: true # FIXME: creating shared libs is not yet stable - ttriple: wasm32-wasi-musl - - shared_libs: true # FIXME: recompile with -fPIC - ttriple: x86_64-linux-gnux32 - - enable_cplusplus: true - shared_libs: true # FIXME: relocation R_MIPS_32 against local symbol - ttriple: mips-linux-musl - - enable_cplusplus: true - shared_libs: true - ttriple: mips64-linux-gnuabi64 - - enable_cplusplus: true - shared_libs: true - ttriple: mips64-linux-musl - - enable_cplusplus: true - shared_libs: true - ttriple: mips64el-linux-musl - - enable_cplusplus: true - shared_libs: true - ttriple: mipsel-linux-gnueabi - - enable_cplusplus: true - shared_libs: true - ttriple: mipsel-linux-musl - - enable_cplusplus: true - shared_libs: true # FIXME: relocation refers to a discarded section - ttriple: powerpc64-linux-gnu - - enable_cplusplus: true - shared_libs: true - ttriple: powerpc64le-linux-musl - - steps: - - uses: actions/checkout@v4 - - uses: korandoru/setup-zig@v1 - with: - zig-version: ${{ matrix.zig_version }} - - name: Build - run: > - zig build -Dtarget=${{ matrix.ttriple }} - -DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} - -DCFLAGS_EXTRA="${{ matrix.cflags_extra }}" - -Denable_cplusplus=${{ matrix.enable_cplusplus }} - -Denable_threads=${{ matrix.enable_threads }} - -Denable_werror diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ca716e600..000000000 --- a/.travis.yml +++ /dev/null @@ -1,896 +0,0 @@ -language: cpp -os: linux -dist: jammy - -jobs: - include: - - compiler: clang - env: - - CONF_OPTIONS="--enable-cplusplus" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--enable-cplusplus" - - GCTEST_WITH_MPROTECT_VDB=true - - 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 --enable-valgrind-tracking" - - 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" - - compiler: clang - env: - - CPPCHECK_ENABLE="--enable=unusedFunction -I libatomic_ops/src extra/gc.c tests/*.c" - - compiler: clang - env: - - CPPCHECK_ENABLE="--enable=unusedFunction --force -D GC_BUILTIN_ATOMIC *.cc cord/*.c cord/tests/*.c tests/*.c" - - CPPCHECK_OUT_FILTER="Z" - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CPPCHECK_ENABLE="-j4 --enable=all --disable=missingInclude,unusedFunction --force -U GC_PRIVATE_H -I libatomic_ops/src a*.c b*.c c*.c d*.c f*.c" - - CPPCHECK_OUT_FILTER="Z" - - compiler: clang - env: - - CPPCHECK_ENABLE="-j4 --enable=all --disable=missingInclude,unusedFunction --force -U GC_PRIVATE_H -I libatomic_ops/src g*.c h*.c m*.c" - - CPPCHECK_OUT_FILTER="Z" - - compiler: clang - env: - - CPPCHECK_ENABLE="-j4 --enable=all --disable=missingInclude,unusedFunction --force -U GC_PRIVATE_H -I libatomic_ops/src n*.c o*.c p*.c r*.c s*.c t*.c w*.c cord/*.c" - - compiler: clang - env: - - CPPCHECK_ENABLE="-j4 --enable=all --disable=missingInclude,unusedFunction --force -I libatomic_ops/src *.cc cord/tests/*.c extra/m*.c extra/*.cpp tests/*.c tests/*.cc tools/*.c" - - CPPCHECK_OUT_FILTER="Z" - - arch: arm64 - compiler: clang - dist: focal - - arch: arm64 - compiler: gcc - dist: focal - - arch: arm64 - compiler: clang - dist: focal - env: - - CFLAGS_EXTRA="-O3" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --disable-shared" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: gcc - dist: focal - 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 - dist: focal - env: - - CONF_OPTIONS="--disable-threads" - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - libatomic-ops-dev - arch: arm64 - compiler: gcc - dist: focal - env: - - CONF_OPTIONS="--with-libatomic-ops=yes --enable-gc-assertions --enable-cplusplus --disable-munmap" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: clang - dist: focal - 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 - dist: focal - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=OFF -Denable_cplusplus=ON -Denable_gc_assertions=ON" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: arm64 - compiler: gcc - dist: focal - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - arch: ppc64le - compiler: clang - dist: focal - env: - - GCTEST_WITH_MPROTECT_VDB=true - - arch: ppc64le - compiler: gcc - dist: focal - env: - - CONF_OPTIONS="--disable-shared --disable-threads" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - dist: focal - env: - - CFLAGS_EXTRA="-O3 -D _FORTIFY_SOURCE=2 -D DONT_PROTECT_PTRFREE -D FORCE_MPROTECT_BEFORE_MADVISE -D GC_UNMAPPED_REGIONS_SOFT_LIMIT=120" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --enable-static" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: gcc - dist: focal - env: - - CFLAGS_EXTRA="-O3 -D NO_MPROTECT_VDB" - - CONF_OPTIONS="--enable-cplusplus" - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - dist: focal - 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 - dist: focal - language: c - env: - - CFLAGS_EXTRA="-fsanitize=memory,undefined -fno-omit-frame-pointer" - - CONF_OPTIONS="--disable-shared" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - TESTS_CUSTOM_RUN=true - - arch: ppc64le - compiler: clang - dist: focal - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON -Denable_gc_assertions=ON" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - arch: ppc64le - compiler: clang - dist: focal - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - GCTEST_WITH_MPROTECT_VDB=true - - arch: s390x - compiler: clang - dist: focal - env: - - GCTEST_WITH_MPROTECT_VDB=true - - arch: s390x - compiler: gcc - dist: focal - env: - - CONF_OPTIONS="--disable-disclaim" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - arch: s390x - compiler: gcc - dist: focal - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - GCTEST_WITH_MPROTECT_VDB=true - - os: freebsd - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-cplusplus --enable-gc-assertions --enable-redirect-malloc --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 -fanalyzer" - - CONF_OPTIONS="--enable-cplusplus" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-D _FORTIFY_SOURCE=2" - - CONF_OPTIONS="--enable-gc-assertions --enable-cplusplus --disable-disclaim --enable-static" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - gcc-multilib - compiler: clang - env: - - CFLAGS_EXTRA="-m32 -funsigned-char -D _FORTIFY_SOURCE=2 -D GC_GCJ_MARK_DESCR_OFFSET=32 -D NO_LONGLONG64" - - CONF_OPTIONS="--enable-gc-assertions" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CONF_OPTIONS="--disable-threads --enable-checksums --disable-handle-fork --disable-munmap --enable-gc-assertions --enable-large-config --enable-static" - - 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 --disable-dynamic-loading" - - 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 -D USE_GETSECTBYNAME" - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: clang - env: - - CFLAGS_EXTRA="-D MARK_BIT_PER_OBJ" - - CONF_OPTIONS="--enable-cplusplus --enable-rwlock --disable-shared" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CFLAGS_EXTRA="-O3 -flto -D _FORTIFY_SOURCE=2 -D NO_MANUAL_VDB" - - CONF_OPTIONS="--disable-parallel-mark --disable-thread-local-alloc --enable-gc-assertions --enable-cplusplus" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: gcc - env: - - CONF_OPTIONS="--enable-gc-debug --enable-cplusplus" - - compiler: gcc - env: - - CONF_OPTIONS="--disable-gc-debug --enable-cplusplus" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: clang - env: - - CONF_OPTIONS="--enable-large-config --enable-cplusplus --disable-shared --enable-static" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - os: osx - env: - - CFLAGS_EXTRA="-D TEST_HANDLE_FORK" - - CONF_OPTIONS="--disable-atomic-uncollectible --enable-cplusplus --enable-rwlock --disable-shared --enable-static" - - os: osx - env: - - CONF_OPTIONS="--enable-large-config --enable-cplusplus --disable-gc-debug --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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: gcc - env: - - CONF_OPTIONS="--enable-large-config --enable-redirect-malloc --disable-threads" - - CFLAGS_EXTRA="-O3 -fanalyzer" - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CONF_OPTIONS="--disable-static --disable-threads --enable-cplusplus" - - CFLAGS_EXTRA="-O3 -march=native -fanalyzer -D DONT_PROTECT_PTRFREE -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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - addons: - apt: - packages: - - libatomic-ops-dev - compiler: clang - env: - - CMAKE_OPTIONS="-Denable_atomic_uncollectable=OFF -Denable_cplusplus=ON -Denable_munmap=OFF -Dwith_libatomic_ops=ON" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: gcc - env: - - CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -Denable_cplusplus=ON -Denable_large_config=ON" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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="-Denable_cplusplus=ON -Denable_gc_assertions=ON -Denable_large_config=ON -Denable_redirect_malloc=ON -Denable_rwlock=ON -DCFLAGS_EXTRA=-DIGNORE_FREE" - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - compiler: gcc - env: - - MAKEFILE_NAME=Makefile.direct - - MAKEFILE_TARGETS="check cord/de" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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 - - addons: - apt: - packages: - - clang-12 - compiler: clang-12 - dist: focal - language: c - env: - - CFLAGS_EXTRA="-fsanitize=memory -fno-omit-frame-pointer -std=gnu11" - - CONF_OPTIONS="--enable-static" - - GCTEST_WITH_MPROTECT_VDB=true - - TESTS_CUSTOM_RUN=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: clang - env: - - CFLAGS_EXTRA="-fsanitize=undefined -fno-common -fno-omit-frame-pointer" - - CONF_OPTIONS="--enable-cplusplus --enable-static" - - GCTEST_WITH_MPROTECT_VDB=true - - TESTS_CUSTOM_RUN=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - 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" - - GCTEST_WITH_MPROTECT_VDB=true - - NO_CLONE_LIBATOMIC_OPS=true - - compiler: gcc - env: - - CC_FOR_CHECK=g++ - - CFLAGS_EXTRA="-std=c++20" - - CONF_OPTIONS="--enable-cplusplus --enable-gc-assertions --enable-gc-debug" - - MAKEFILE_TARGETS="clean" - - 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.72 - - AUTOMAKE_VER=1.17 - - LIBTOOL_VER=2.5.4 - - M4_VER=1.4.19 - - NO_CLONE_LIBATOMIC_OPS=true - -before_install: -- if [[ "$CPPCHECK_ENABLE" != "" ]]; then - CPPCHECK_VER=2.14.2; - 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 --parallel; - fi -- if [[ "$CMAKE_OPTIONS" != "" ]]; then - ctest --verbose --parallel 4; - 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/*.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 -D CPPCHECK - -I include --check-level=exhaustive $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 -- if [[ "$GCTEST_WITH_MPROTECT_VDB" == true ]]; then - GC_USE_GETWRITEWATCH=0 ./gctest; - 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 - -before_deploy: -- yes | gem update --system --force -- gem install bundler -- gem install uri -- gem install logger - -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/cord/tests/de.c b/cord/tests/de.c index 7d27537b6..87273661d 100644 --- a/cord/tests/de.c +++ b/cord/tests/de.c @@ -80,18 +80,20 @@ /* List of line number to position mappings, in descending order. */ /* There may be holes. */ -typedef struct LineMapRep { +struct LineMapRep { int line; size_t pos; struct LineMapRep *previous; -} * line_map; +}; +typedef struct LineMapRep *line_map; -/* List of file versions, one per edit operation */ -typedef struct HistoryRep { +/* List of file versions, one per edit operation. */ +struct HistoryRep { CORD file_contents; struct HistoryRep *previous; - line_map map; /* Invalid for first record "now" */ -} * history; + line_map map; /* invalid for the first record "now" */ +}; +typedef struct HistoryRep *history; history now = 0; CORD current; /* == now -> file_contents. */ diff --git a/finalize.c b/finalize.c index af1958704..e77c3f517 100644 --- a/finalize.c +++ b/finalize.c @@ -27,7 +27,7 @@ typedef void (*finalization_mark_proc)(ptr_t /* finalizable_obj_ptr */); # define HASH3(addr, size, log_size) \ ((size_t)((ADDR(addr) >> 3) ^ (ADDR(addr) >> (3 + (log_size)))) \ - & ((size)-1)) + & ((size) - (size_t)1)) # define HASH2(addr, log_size) HASH3(addr, (size_t)1 << (log_size), log_size) struct hash_chain_entry { diff --git a/include/gc/cord_pos.h b/include/gc/cord_pos.h index 835ad4c38..60576a64a 100644 --- a/include/gc/cord_pos.h +++ b/include/gc/cord_pos.h @@ -120,7 +120,8 @@ CORD_API void CORD__prev(CORD_pos); /* Advance position by n characters; n should be positive and less */ /* than CORD_pos_chars_left(p). */ -# define CORD_pos_advance(p, n) ((p)[0].cur_pos += (n)-1, CORD_next(p)) +# define CORD_pos_advance(p, n) \ + ((p)[0].cur_pos += (n) - (size_t)1, CORD_next(p)) /* Address of the current character in cache. */ # define CORD_pos_cur_char_addr(p) \ diff --git a/include/gc/gc.h b/include/gc/gc.h index 7e00d0409..2e19a21a2 100644 --- a/include/gc/gc.h +++ b/include/gc/gc.h @@ -2316,11 +2316,11 @@ GC_API void *GC_CALL GC_find_limit(void * /* start */, int /* up */); #if defined(GC_INITIAL_HEAP_SIZE) && !defined(CPPCHECK) /* Set heap size to the desired value at start-up */ -# define GC_INIT_CONF_INITIAL_HEAP_SIZE \ - { \ - size_t heap_size = GC_get_heap_size(); \ - if (heap_size < (GC_INITIAL_HEAP_SIZE)) \ - (void)GC_expand_hp((GC_INITIAL_HEAP_SIZE)-heap_size); \ +# define GC_INIT_CONF_INITIAL_HEAP_SIZE \ + { \ + size_t heap_size = GC_get_heap_size(); \ + if (heap_size < (size_t)(GC_INITIAL_HEAP_SIZE)) \ + (void)GC_expand_hp(((size_t)(GC_INITIAL_HEAP_SIZE)) - heap_size); \ } #else # define GC_INIT_CONF_INITIAL_HEAP_SIZE /* empty */ diff --git a/include/gc/gc_inline.h b/include/gc/gc_inline.h index e5f753b72..4ce06fb20 100644 --- a/include/gc/gc_inline.h +++ b/include/gc/gc_inline.h @@ -167,7 +167,7 @@ GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void *GC_CALL GC_end_stubborn_change(my_fl); \ GC_reachable_here(next); \ } \ - GC_ASSERT(GC_size(result) >= GC_GRANULE_BYTES * (lg)); \ + GC_ASSERT(GC_size(result) >= GC_RAW_BYTES_FROM_INDEX(lg)); \ GC_ASSERT((k) == GC_I_PTRFREE \ || 0 /* NULL */ == ((void **)result)[1]); \ break; \ @@ -188,7 +188,7 @@ GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void *GC_CALL k, my_fl); \ my_entry = *my_fl; \ if (0 /* NULL */ == my_entry) { \ - result = (*GC_get_oom_fn())(GC_GRANULE_BYTES * (lg)); \ + result = (*GC_get_oom_fn())(GC_RAW_BYTES_FROM_INDEX(lg)); \ break; \ } \ } \ @@ -203,12 +203,13 @@ GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void *GC_CALL /* allocator lock. The caller is responsible for supplying a cleared */ /* tiny_fl free-list array. For single-threaded applications, this may */ /* be a global array. */ -#define GC_MALLOC_WORDS_KIND(result, n, tiny_fl, k, init) \ - do { \ - size_t lg = GC_PTRS_TO_WHOLE_GRANULES(n); \ - \ - GC_FAST_MALLOC_GRANS(result, lg, tiny_fl, 0 /* num_direct */, k, \ - GC_malloc_kind((lg)*GC_GRANULE_BYTES, k), init); \ +#define GC_MALLOC_WORDS_KIND(result, n, tiny_fl, k, init) \ + do { \ + size_t lg = GC_PTRS_TO_WHOLE_GRANULES(n); \ + \ + GC_FAST_MALLOC_GRANS(result, lg, tiny_fl, 0 /* num_direct */, k, \ + GC_malloc_kind(GC_RAW_BYTES_FROM_INDEX(lg), k), \ + init); \ } while (0) #define GC_MALLOC_WORDS(result, n, tiny_fl) \ diff --git a/include/private/dbg_mlc.h b/include/private/dbg_mlc.h index 5c2322d7f..5225c5c62 100644 --- a/include/private/dbg_mlc.h +++ b/include/private/dbg_mlc.h @@ -177,8 +177,9 @@ GC_INNER int GC_has_other_debug_info(ptr_t base); (((GC_uintptr_t)GC_cptr_load((volatile ptr_t *)(base)) & 1) != 0 \ && GC_has_other_debug_info(base) > 0) # else -# define GC_HAS_DEBUG_INFO(base) \ - ((*(GC_uintptr_t *)(base)&1) != 0 && GC_has_other_debug_info(base) > 0) +# define GC_HAS_DEBUG_INFO(base) \ + (((*(GC_uintptr_t *)(base)) & 1) != 0 \ + && GC_has_other_debug_info(base) > 0) # endif #else # define GC_HAS_DEBUG_INFO(base) (GC_has_other_debug_info(base) > 0) diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index fbc198aac..4a852b2be 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -929,10 +929,10 @@ EXTERN_C_BEGIN #endif #define BYTES_TO_GRANULES(lb) ((lb) / GC_GRANULE_BYTES) -#define GRANULES_TO_BYTES(lg) ((lg)*GC_GRANULE_BYTES) +#define GRANULES_TO_BYTES(lg) (GC_GRANULE_BYTES * (lg)) #define BYTES_TO_PTRS(lb) ((lb) / sizeof(ptr_t)) #define PTRS_TO_BYTES(lpw) ((lpw) * sizeof(ptr_t)) -#define GRANULES_TO_PTRS(lg) ((lg)*GC_GRANULE_PTRS) +#define GRANULES_TO_PTRS(lg) (GC_GRANULE_PTRS * (lg)) /* Convert size in bytes to that in pointers rounding up (but */ /* not adding extra byte at end). */ @@ -2032,7 +2032,7 @@ GC_INNER void GC_push_all_register_sections( # define MARK_BIT_OFFSET(sz) BYTES_TO_GRANULES(sz) # define FINAL_MARK_BIT(sz) \ ((sz) > MAXOBJBYTES ? MARK_BITS_PER_HBLK \ - : BYTES_TO_GRANULES((sz)*HBLK_OBJS(sz))) + : BYTES_TO_GRANULES(HBLK_OBJS(sz) * (sz))) #endif /* !MARK_BIT_PER_OBJ */ /* Important internal collector routines. */ @@ -2183,15 +2183,15 @@ ptr_t GC_save_regs_in_stack(void); } while (0) # ifdef THREADS -# define PS_COMPUTE_ADJUSTED_OFS(padj_ps_ofs, ps_ofs, ofs_sz_ull) \ - do { \ - if ((ofs_sz_ull) <= (ps_ofs) /* && ofs_sz_ull > 0 */) \ - ABORT_ARG2("Incorrect size of procedure stack", \ - ": ofs= %lu, size= %lu", (unsigned long)(ps_ofs), \ - (unsigned long)(ofs_sz_ull)); \ - *(padj_ps_ofs) = (ps_ofs) > PS_SYSCALL_TAIL_BYTES \ - ? (ps_ofs)-PS_SYSCALL_TAIL_BYTES \ - : 0; \ +# define PS_COMPUTE_ADJUSTED_OFS(padj_ps_ofs, ps_ofs, ofs_sz_ull) \ + do { \ + if ((ofs_sz_ull) <= (ps_ofs) /* && ofs_sz_ull > 0 */) \ + ABORT_ARG2("Incorrect size of procedure stack", \ + ": ofs= %lu, size= %lu", (unsigned long)(ps_ofs), \ + (unsigned long)(ofs_sz_ull)); \ + *(padj_ps_ofs) = (ps_ofs) > (unsigned)PS_SYSCALL_TAIL_BYTES \ + ? (ps_ofs) - (unsigned)PS_SYSCALL_TAIL_BYTES \ + : 0; \ } while (0) # else /* A simplified variant of the above assuming ps_ofs is a zero const. */ @@ -3165,7 +3165,10 @@ GC_INNER word GC_compute_root_size(void); static_assert(expr, "static assertion failed: " #expr) #elif defined(static_assert) && !defined(CPPCHECK) \ && (__STDC_VERSION__ >= 201112L) -# define GC_STATIC_ASSERT(expr) static_assert(expr, # expr) +# define GC_STATIC_ASSERT(expr) \ + do { /* Wrap into do-while as a workaround for clang-format. */ \ + static_assert(expr, #expr); \ + } while (0) #elif defined(mips) && !defined(__GNUC__) && !defined(CPPCHECK) /* DOB: MIPSPro C gets an internal error taking the sizeof an array type. This code works correctly (ugliness is to avoid "unused var" warnings) */ diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 8a8a04bcd..3e5c42758 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -781,10 +781,10 @@ EXTERN_C_BEGIN # define PTR_ALIGN_UP(p, b) __builtin_align_up(p, b) #else # define PTR_ALIGN_DOWN(p, b) \ - ((ptr_t)((GC_uintptr_t)(p) & ~(GC_uintptr_t)((b)-1))) -# define PTR_ALIGN_UP(p, b) \ - ((ptr_t)(((GC_uintptr_t)(p) + (GC_uintptr_t)((b)-1)) \ - & ~(GC_uintptr_t)((b)-1))) + ((ptr_t)((GC_uintptr_t)(p) & ~((GC_uintptr_t)(b) - (GC_uintptr_t)1))) +# define PTR_ALIGN_UP(p, b) \ + ((ptr_t)(((GC_uintptr_t)(p) + (GC_uintptr_t)(b) - (GC_uintptr_t)1) \ + & ~((GC_uintptr_t)(b) - (GC_uintptr_t)1))) #endif /* If available, we can use __builtin_unwind_init() to push the */ @@ -1446,7 +1446,7 @@ extern int _etext, _end; # ifndef USE_MMAP # define USE_MMAP 1 # endif -# define MAP_FAILED (void *)((GC_uintptr_t)-1) +# define MAP_FAILED ((void *)(~(GC_uintptr_t)0)) # define HEAP_START ((word)0x40000000) # endif /* DGUX */ # ifdef LINUX @@ -2357,7 +2357,7 @@ LONG64 durango_get_stack_bottom(void); # define PROT_EXEC 4 # define MAP_PRIVATE 2 # define MAP_FIXED 0x10 -# define MAP_FAILED ((void *)-1) +# define MAP_FAILED ((void *)(~(GC_uintptr_t)0)) # endif # ifdef MSWIN32 # define RETRY_GET_THREAD_CONTEXT @@ -2471,9 +2471,9 @@ void *emmalloc_memalign(size_t align, size_t lb); # ifdef WASI # define OS_TYPE "WASI" extern char __global_base, __heap_base; -# define STACKBOTTOM ((ptr_t)&__global_base) -# define DATASTART ((ptr_t)&__global_base) -# define DATAEND ((ptr_t)&__heap_base) +# define DATASTART ((ptr_t)(&__global_base)) +# define DATAEND ((ptr_t)(&__heap_base)) +# define STACKBOTTOM DATASTART # ifndef GC_NO_SIGSETJMP # define GC_NO_SIGSETJMP 1 /* no support of signals */ # endif @@ -3408,7 +3408,7 @@ extern ptr_t GC_data_start; # define NEED_FIXUP_POINTER #elif defined(DYNAMIC_POINTER_MASK) # define FIXUP_POINTER(p) \ - (p = (ptr_t)(((word)(p)&GC_pointer_mask) << GC_pointer_shift)) + (p = (ptr_t)((((word)(p)) & GC_pointer_mask) << GC_pointer_shift)) # undef POINTER_MASK # undef POINTER_SHIFT # define NEED_FIXUP_POINTER diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h index 603f5d5da..5b98d2e95 100644 --- a/include/private/pthread_support.h +++ b/include/private/pthread_support.h @@ -60,7 +60,7 @@ typedef struct GC_NT_TIB_s GC_NT_TIB; # endif # endif -typedef struct GC_StackContext_Rep { +struct GC_StackContext_Rep { # if defined(THREAD_SANITIZER) && defined(SIGNAL_BASED_STOP_WORLD) /* A dummy field to avoid TSan false positive about the race */ /* between GC_has_other_debug_info and GC_suspend_handler_inner */ @@ -133,7 +133,8 @@ typedef struct GC_StackContext_Rep { /* Points to the "frame" data held in stack by the innermost */ /* GC_call_with_gc_active() of this stack (thread); may be NULL. */ struct GC_traced_stack_sect_s *traced_stack_sect; -} * GC_stack_context_t; +}; +typedef struct GC_StackContext_Rep *GC_stack_context_t; # ifdef GC_WIN32_THREADS typedef DWORD thread_id_t; @@ -150,7 +151,7 @@ typedef pthread_t thread_id_t; # define THREAD_ID_TO_VPTR(id) PTHREAD_TO_VPTR(id) # endif -typedef struct GC_Thread_Rep { +struct GC_Thread_Rep { union { # if !defined(GC_NO_THREADS_DISCOVERY) && defined(GC_WIN32_THREADS) /* Updated without a lock. We assert that each unused entry has */ @@ -278,7 +279,8 @@ typedef struct GC_Thread_Rep { /* needed for GetThreadContext() to succeed. */ word context_regs[PUSHED_REGS_COUNT]; # endif -} * GC_thread; +}; +typedef struct GC_Thread_Rep *GC_thread; # if defined(GC_PTHREADS) || defined(GC_PTHREADS_PARAMARK) /* Convert an opaque pthread_t value to a pointer identifying the thread. */ diff --git a/include/private/thread_local_alloc.h b/include/private/thread_local_alloc.h index 79765b2a3..fe95e1486 100644 --- a/include/private/thread_local_alloc.h +++ b/include/private/thread_local_alloc.h @@ -120,7 +120,7 @@ EXTERN_C_BEGIN /* allocation, equivalent to 0; */ /* - >=HBLKSIZE means pointer to nonempty free list. */ -typedef struct thread_local_freelists { +struct thread_local_freelists { /* Note: Preserve *_freelists names for some clients. */ void *_freelists[THREAD_FREELISTS_KINDS][GC_TINY_FREELISTS]; # define ptrfree_freelists _freelists[PTRFREE] @@ -133,7 +133,8 @@ typedef struct thread_local_freelists { /* Do not use local free lists for up to this much allocation. */ # define DIRECT_GRANULES (HBLKSIZE / GC_GRANULE_BYTES) -} * GC_tlfs; +}; +typedef struct thread_local_freelists *GC_tlfs; # if defined(USE_PTHREAD_SPECIFIC) # define GC_getspecific pthread_getspecific diff --git a/os_dep.c b/os_dep.c index a3afcc7ab..3809da7c4 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1226,8 +1226,9 @@ os_main_stackbottom(void) /* low while the initialization code is running. */ if ((ADDR(__libc_stack_end) & 0xfff) + 0x10 < 0x1000) { return __libc_stack_end + 0x10; - } /* Otherwise it's not safe to add 16 bytes and we fall */ - /* back to using /proc. */ + } else { + /* It is not safe to add 16 bytes. Thus, fallback to using /proc. */ + } # elif defined(SPARC) /* Older versions of glibc for 64-bit SPARC do not set this */ /* variable correctly, it gets set to either zero or one. */ @@ -4872,7 +4873,7 @@ GC_mprotect_thread(void *arg) # endif } } /* switch */ - } /* for */ + } } /* All this SIGBUS code should not be necessary. All protection faults */ diff --git a/tests/gctest.c b/tests/gctest.c index 2965407e2..06e7e9106 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -381,10 +381,13 @@ gcj_cons(sexpr x, sexpr y) size_t cnt = (size_t)AO_fetch_and_add1(&extra_count); const void *d = (cnt & 1) != 0 ? &gcj_class_struct1 : &gcj_class_struct2; size_t lb = sizeof(struct SEXPR) + sizeof(struct fake_vtable *); - void *r = (cnt & 2) != 0 ? GC_GCJ_MALLOC_IGNORE_OFF_PAGE( - lb + (cnt <= HBLKSIZE / 2 ? cnt : 0), d) - : GC_GCJ_MALLOC(lb, d); + void *r; + if ((cnt & 2) != 0) { + r = GC_GCJ_MALLOC_IGNORE_OFF_PAGE(lb + (cnt <= HBLKSIZE / 2 ? cnt : 0), d); + } else { + r = GC_GCJ_MALLOC(lb, d); + } CHECK_OUT_OF_MEMORY(r); AO_fetch_and_add1(&collectable_count); /* Skip vtable pointer. */ @@ -2022,7 +2025,8 @@ test_long_mult(void) #endif } -#define NUMBER_ROUND_UP(v, bound) ((((v) + (bound)-1) / (bound)) * (bound)) +#define NUMBER_ROUND_UP(v, bound) \ + ((((v) + (bound) - (unsigned)1) / (bound)) * (bound)) static size_t initial_heapsize; diff --git a/tests/trace.c b/tests/trace.c index 152a6eb38..8f896120e 100644 --- a/tests/trace.c +++ b/tests/trace.c @@ -20,7 +20,9 @@ struct treenode { struct treenode *x; struct treenode *y; -} * root[10]; +}; + +static struct treenode *root[10]; static struct treenode * mktree(int i) diff --git a/win32_threads.c b/win32_threads.c index 4609b1672..a69a56ff0 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -645,7 +645,7 @@ GC_start_world(void) /* argument later and must not be used as the lower bound for sp */ /* check (since the stack may be bigger than 64 KiB). */ # define GC_wince_evaluate_stack_min(s) \ - (ptr_t)(((word)(s)-1) & ~(word)0xFFFF) + (ptr_t)(((word)(s) - (word)1) & ~(word)0xFFFF) # elif defined(GC_ASSERTIONS) # define GC_dont_query_stack_min FALSE # endif @@ -1233,7 +1233,7 @@ GC_start_mark_threads_inner(void) handle = _beginthreadex(NULL /* security_attr */, MARK_THREAD_STACK_SIZE, GC_mark_thread, NUMERIC_TO_VPTR(i), 0 /* flags */, &thread_id); - if (EXPECT(!handle || handle == (GC_uintptr_t)-1L, FALSE)) { + if (EXPECT(!handle || handle == ~(GC_uintptr_t)0, FALSE)) { WARN("Marker thread %" WARN_PRIdPTR " creation failed\n", (GC_signed_word)i); /* Don't try to create other marker threads. */