From 46ce01223ba202c4956afc1a244b60c9096c9599 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sat, 14 Dec 2024 13:34:03 +0100 Subject: [PATCH] staticbuilds: Fix aarch64 cross-compile We get "undefined reference to `__memmove_chk'" when compiling pcre2 (via pcre2-sys) on newer Ubuntu. That one is used with higher fortify_source levels, and Ubuntu 24.04 defaults to 3, while my arch system (where I cannot reproduce) defaults to 2. --- .github/workflows/staticbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staticbuild.yml b/.github/workflows/staticbuild.yml index e49908209..da8db230a 100644 --- a/.github/workflows/staticbuild.yml +++ b/.github/workflows/staticbuild.yml @@ -32,7 +32,7 @@ jobs: sudo apt install musl-tools crossbuild-essential-arm64 -y - name: Build run: | - CMAKE_WITH_GETTEXT=0 CC=aarch64-linux-gnu-gcc RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc -C link-arg=-lgcc" cargo build --release --target aarch64-unknown-linux-musl + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" CMAKE_WITH_GETTEXT=0 CC=aarch64-linux-gnu-gcc RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc -C link-arg=-lgcc -C link-arg=-D_FORTIFY_SOURCE=0" cargo build --release --target aarch64-unknown-linux-musl cargo build --release --target x86_64-unknown-linux-musl - name: Compress run: |