From 18bc3bfcf06ab4ba8f63050cd7c977e15b8d9d90 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Sat, 24 Sep 2022 20:37:51 +0100 Subject: [PATCH] CI: Further adjustments to 32 vs 64bit building It turns out that CodeQL gets confused with an integer 'bits' value in the matrix, causing it to merge results. Switch to using strings values instead. Additionally, M32 is a very unintuitive name. Change the build system to take a BITS=32/64 input and parse it appropriately. Update the build invocations to match. Signed-off-by: Andrew Cooper --- .github/workflows/build.yml | 4 ++-- .github/workflows/scan-build.yml | 4 ++-- Makefile | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 887660a..ec84603 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: compiler: [gcc-9, gcc-10, gcc-11, clang-12, clang-13, clang-14] - bits: [32, 64] + bits: ['32', '64'] lto: [LTO=y, LTO=n] runs-on: 'ubuntu-22.04' @@ -23,5 +23,5 @@ jobs: - name: make run: | - make CC=${{matrix.compiler}} M32=${{matrix.bits == 32 && 'y' || 'n'}} ${{matrix.lto}} + make CC=${{matrix.compiler}} BITS=${{matrix.bits}} ${{matrix.lto}} ./extend_skl_only.sh diff --git a/.github/workflows/scan-build.yml b/.github/workflows/scan-build.yml index 3ff89f4..0ebc9f1 100644 --- a/.github/workflows/scan-build.yml +++ b/.github/workflows/scan-build.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: - bits: [32, 64] + bits: ['32', '64'] lto: [LTO=y, LTO=n] runs-on: 'ubuntu-22.04' @@ -22,4 +22,4 @@ jobs: - name: make run: | - scan-build-14 --status-bugs -analyze-headers make M32=${{matrix.bits == 32 && 'y' || 'n'}} ${{matrix.lto}} + scan-build-14 --status-bugs -analyze-headers make BITS=${{matrix.bits}} ${{matrix.lto}} diff --git a/Makefile b/Makefile index dac53ae..f03300c 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,15 @@ CFLAGS += -flto LDFLAGS += -flto endif -ifeq ($(M32),y) +BITS ?= 64 +ifeq ($(BITS),32) CFLAGS += -m32 -mregparm=3 -fno-plt -freg-struct-return LDFLAGS += -m32 -else +else ifeq ($(BITS),64) CFLAGS += -m64 LDFLAGS += -m64 +else +$(error Bad $$(BITS) value '$(BITS)') endif # There is a 64k total limit, so optimise for size. The binary may be loaded