From 71e1469dee53bfdb6b275dd1be19f6eb21a0c023 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Sun, 26 May 2024 08:53:59 -0500 Subject: [PATCH] Add CAPSTONE_DIET build test. --- .github/workflows/CITest.yml | 31 +++++++++++++++++++++++++------ COMPILE_CMAKE.TXT | 2 +- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CITest.yml b/.github/workflows/CITest.yml index ead5fc7f9e..8f7601ce27 100644 --- a/.github/workflows/CITest.yml +++ b/.github/workflows/CITest.yml @@ -45,7 +45,8 @@ jobs: python-arch: x64, python-version: '3.9', build-system: 'make', - enable-asan: 'OFF' + enable-asan: 'OFF', + diet-build: 'OFF' } - { name: 'ubuntu-22.04 x64 python3.9 cmake', @@ -54,7 +55,8 @@ jobs: python-arch: x64, python-version: '3.9', build-system: 'cmake', - enable-asan: 'OFF' + enable-asan: 'OFF', + diet-build: 'OFF' } - { name: 'ubuntu-22.04 x64 python3.11 cmake', @@ -63,7 +65,8 @@ jobs: python-arch: x64, python-version: '3.11', build-system: 'cmake', - enable-asan: 'OFF' + enable-asan: 'OFF', + diet-build: 'OFF' } - { name: 'ubuntu-22.04 x64 python3.11 ASAN', @@ -72,7 +75,18 @@ jobs: python-arch: x64, python-version: '3.11', build-system: 'cmake', - enable-asan: 'ON' + enable-asan: 'ON', + diet-build: 'OFF' + } + - { + name: 'ubuntu-22.04 x64 python3.11 DIET + ASAN', + os: ubuntu-latest, + arch: x64, + python-arch: x64, + python-version: '3.11', + build-system: 'cmake', + enable-asan: 'ON', + diet-build: 'ON' } steps: @@ -103,13 +117,14 @@ jobs: if: startsWith(matrix.config.build-system, 'cmake') env: asan: ${{ matrix.config.enable-asan }} + diet_build: ${{ matrix.config.diet-build }} run: | mkdir build && cd build # build static library cmake -DCAPSTONE_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/usr .. cmake --build . --config Release # build shared library - cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} .. + cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} -DCAPSTONE_BUILD_DIET=${diet_build} .. sudo cmake --build . --config Release --target install cp libcapstone.* ../ cp libcapstone.* ../tests/ @@ -130,10 +145,14 @@ jobs: run: | sh suite/run_invalid_cstool.sh - - name: cstest (cmake) + - name: cstest (cmake) - MC regression if: startsWith(matrix.config.build-system, 'cmake') run: | python suite/cstest/cstest_report.py -D -d suite/MC + + - name: cstest (cmake) - details + if: startsWith(matrix.config.build-system, 'cmake') && startsWith(matrix.config.diet-build, 'OFF') + run: | python suite/cstest/cstest_report.py -D -f suite/cstest/issues.cs python suite/cstest/cstest_report.py -D -f tests/cs_details/issue.cs diff --git a/COMPILE_CMAKE.TXT b/COMPILE_CMAKE.TXT index a35396d511..e0914b36f6 100644 --- a/COMPILE_CMAKE.TXT +++ b/COMPILE_CMAKE.TXT @@ -52,7 +52,7 @@ Get CMake for free from http://www.cmake.org. Besides, Capstone also allows some more customization via following macros. - CAPSTONE_USE_SYS_DYN_MEM: change this to OFF to use your own dynamic memory management. - - CAPSTONE_BUILD_DIET: change this to ON to make the binaries more compact. + - CAPSTONE_BUILD_DIET: change this to ON to make the binaries more compact. In exchange for no details. - CAPSTONE_X86_REDUCE: change this to ON to make X86 binary smaller. - CAPSTONE_X86_ATT_DISABLE: change this to ON to disable AT&T syntax on x86. - CAPSTONE_DEBUG: change this to ON to enable extra debug assertions.