diff --git a/.github/workflows/build-all-and-publish.yml b/.github/workflows/build-all-and-publish.yml
index 815d7a3..59a69bf 100644
--- a/.github/workflows/build-all-and-publish.yml
+++ b/.github/workflows/build-all-and-publish.yml
@@ -16,33 +16,36 @@ jobs:
linux:
name: Linux natives (${{ matrix.arch }})
runs-on: ubuntu-latest
+ env:
+ 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
+ NATIVE_XXHASH_EXTRA_CFLAGS: -fno-tree-vectorize
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
cc: gcc
- cflags: ""
+ arch_cflags: ""
ldflags: ""
apt: ""
- arch: i386
cc: gcc
- cflags: "-m32"
+ arch_cflags: "-m32"
ldflags: ""
apt: "gcc-multilib libc6-dev-i386"
- arch: aarch64
cc: aarch64-linux-gnu-gcc
- cflags: ""
+ arch_cflags: ""
ldflags: ""
apt: "gcc-aarch64-linux-gnu"
- arch: ppc64le
cc: powerpc64le-linux-gnu-gcc
- cflags: ""
+ arch_cflags: ""
ldflags: ""
apt: "gcc-powerpc64le-linux-gnu"
- arch: s390x
cc: s390x-linux-gnu-gcc
- cflags: ""
+ arch_cflags: ""
ldflags: ""
apt: "gcc-s390x-linux-gnu"
@@ -73,12 +76,13 @@ jobs:
- name: Build (mvn package)
run: |
- ./mvnw -B -V -DskipTests \
- -Darch.id=${{ matrix.arch }} \
- -Dnative.cc=${{ matrix.cc }} \
- "-Dnative.cflags=${{ matrix.cflags }}" \
- "-Dnative.ldflags=${{ matrix.ldflags }}" \
- package
+ ./mvnw -B -V -DskipTests \
+ -Darch.id=${{ matrix.arch }} \
+ -Dnative.cc=${{ matrix.cc }} \
+ "-Dnative.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_cflags }}" \
+ "-Dnative.xxhash.cflags=${{ env.NATIVE_BASE_CFLAGS }} ${{ matrix.arch_cflags }} ${{ env.NATIVE_XXHASH_EXTRA_CFLAGS }}" \
+ "-Dnative.ldflags=${{ matrix.ldflags }}" \
+ package
- name: Upload native library
uses: actions/upload-artifact@v4
diff --git a/pom.xml b/pom.xml
index 8f4525a..466dd71 100644
--- a/pom.xml
+++ b/pom.xml
@@ -388,6 +388,10 @@
Linux
+
+ -O2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection
+ ${native.cflags} -fno-tree-vectorize
+
@@ -417,20 +421,75 @@
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+