Skip to content

Commit

Permalink
CI: Further adjustments to 32 vs 64bit building
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andyhhp committed Nov 20, 2023
1 parent 1c86620 commit 18bc3bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/scan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

strategy:
matrix:
bits: [32, 64]
bits: ['32', '64']
lto: [LTO=y, LTO=n]

runs-on: 'ubuntu-22.04'
Expand All @@ -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}}
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 18bc3bf

Please sign in to comment.