Skip to content

Commit 395b8d9

Browse files
committed
Make Linux native flags architecture-safe in CI
1 parent f659131 commit 395b8d9

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/build-all-and-publish.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
name: Linux natives (${{ matrix.arch }})
1818
runs-on: ubuntu-latest
1919
env:
20-
NATIVE_BASE_CFLAGS: -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection
20+
NATIVE_BASE_CFLAGS: -O2 -fno-omit-frame-pointer -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security
21+
NATIVE_X86_EXTRA_CFLAGS: -mno-omit-leaf-frame-pointer -fcf-protection
2122
NATIVE_XXHASH_EXTRA_CFLAGS: -fno-tree-vectorize
2223
strategy:
2324
fail-fast: false
@@ -26,26 +27,31 @@ jobs:
2627
- arch: amd64
2728
cc: gcc
2829
arch_cflags: ""
30+
arch_x86_cflags: "${{ env.NATIVE_X86_EXTRA_CFLAGS }}"
2931
ldflags: ""
3032
apt: ""
3133
- arch: i386
3234
cc: gcc
3335
arch_cflags: "-m32"
34-
ldflags: ""
36+
arch_x86_cflags: "${{ env.NATIVE_X86_EXTRA_CFLAGS }}"
37+
ldflags: "-m32"
3538
apt: "gcc-multilib libc6-dev-i386"
3639
- arch: aarch64
3740
cc: aarch64-linux-gnu-gcc
3841
arch_cflags: ""
42+
arch_x86_cflags: ""
3943
ldflags: ""
4044
apt: "gcc-aarch64-linux-gnu"
4145
- arch: ppc64le
4246
cc: powerpc64le-linux-gnu-gcc
4347
arch_cflags: ""
48+
arch_x86_cflags: ""
4449
ldflags: ""
4550
apt: "gcc-powerpc64le-linux-gnu"
4651
- arch: s390x
4752
cc: s390x-linux-gnu-gcc
4853
arch_cflags: ""
54+
arch_x86_cflags: ""
4955
ldflags: ""
5056
apt: "gcc-s390x-linux-gnu"
5157

@@ -79,8 +85,8 @@ jobs:
7985
./mvnw -B -V -DskipTests \
8086
-Darch.id=${{ matrix.arch }} \
8187
-Dnative.cc=${{ matrix.cc }} \
82-
"-Dnative.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_cflags }}" \
83-
"-Dnative.xxhash.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_cflags }} ${{ env.NATIVE_XXHASH_EXTRA_CFLAGS }}" \
88+
"-Dnative.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_x86_cflags }} ${{ matrix.arch_cflags }}" \
89+
"-Dnative.xxhash.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_x86_cflags }} ${{ matrix.arch_cflags }} ${{ env.NATIVE_XXHASH_EXTRA_CFLAGS }}" \
8490
"-Dnative.ldflags=${{ matrix.ldflags }}" \
8591
package
8692

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
</os>
390390
</activation>
391391
<properties>
392-
<native.cflags>-O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection</native.cflags>
392+
<native.cflags>-O2 -fno-omit-frame-pointer -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security</native.cflags>
393393
<native.xxhash.cflags>${native.cflags} -fno-tree-vectorize</native.xxhash.cflags>
394394
</properties>
395395
<build>

0 commit comments

Comments
 (0)