Skip to content

Commit 48980da

Browse files
authored
glibc (≥2.31)
Signed-off-by: Hasan ÇALIŞIR <hasan.calisir@psauxit.com>
1 parent 6593c5d commit 48980da

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/build-and-commit-safexec.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ jobs:
7272
# build- libnpp_norm.so (LD_PRELOAD shim) — glibc + musl for x64 + arm64
7373
############################################################
7474

75-
# x86_64 (glibc) — build in Debian
75+
# x86_64 (glibc) — build in Debian (bullseye) older glibc (≥2.31)
7676
- name: Build libnpp_norm (x86_64, glibc)
7777
run: |
7878
set -euo pipefail
79-
docker run --rm -v "$PWD":/src -w /src debian:stable-slim bash -euxo pipefail -c '
79+
docker run --rm -v "$PWD":/src -w /src debian:bullseye-slim bash -euxo pipefail -c '
8080
apt-get update
8181
apt-get install -y --no-install-recommends build-essential binutils
8282
gcc -O2 -pipe -fPIC -Wall -Wextra -Wformat=2 -DWGET_FASTPATH \
@@ -96,18 +96,23 @@ jobs:
9696
-Wl,-z,relro,-z,now -Wl,-z,noexecstack -ldl -pthread
9797
strip --strip-unneeded libnpp_norm-x86_64-musl.so
9898
'
99+
# Enable qemu/binfmt
100+
- name: Enable binfmt for arm64 (early)
101+
run: |
102+
set -euo pipefail
103+
docker run --privileged --rm tonistiigi/binfmt --install arm64
99104
100-
# aarch64 (glibc) — build in dockcross glibc toolchain
105+
# aarch64 (glibc) — build in Ubuntu focal (arm64) older glibc (≥2.31)
101106
- name: Build libnpp_norm (aarch64, glibc)
102107
run: |
103108
set -euo pipefail
104-
docker run --rm dockcross/linux-arm64 > ./dockcross.arm64
105-
chmod +x ./dockcross.arm64
106-
./dockcross.arm64 bash -euxc '
107-
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fPIC -Wall -Wextra -Wformat=2 -DWGET_FASTPATH \
108-
-shared safexec/libnpp_norm.c -o safexec/libnpp_norm-aarch64-glibc.so \
109-
-Wl,-z,relro,-z,now -Wl,-z,noexecstack -ldl -pthread
110-
aarch64-unknown-linux-gnu-strip --strip-unneeded safexec/libnpp_norm-aarch64-glibc.so
109+
docker run --rm --platform=linux/arm64 -v "$PWD":/src -w /src ubuntu:20.04 bash -euxo pipefail -c '
110+
apt-get update
111+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends build-essential binutils
112+
gcc -O2 -pipe -fPIC -Wall -Wextra -Wformat=2 -DWGET_FASTPATH \
113+
-shared safexec/libnpp_norm.c -o safexec/libnpp_norm-aarch64-glibc.so \
114+
-Wl,-z,relro,-z,now -Wl,-z,noexecstack -ldl -pthread
115+
strip --strip-unneeded safexec/libnpp_norm-aarch64-glibc.so
111116
'
112117
113118
# aarch64 (musl) — build in dockcross musl toolchain
@@ -505,7 +510,7 @@ jobs:
505510
set -euo pipefail
506511
sudo apt-get update
507512
sudo apt-get install -y --no-install-recommends \
508-
devscripts debhelper dpkg-dev lintian build-essential fakeroot
513+
devscripts debhelper dpkg-dev lintian build-essential fakeroot sudo debhelper-compat
509514
510515
- name: Resolve version from safexec -v
511516
id: ver
@@ -554,7 +559,7 @@ jobs:
554559
set -euo pipefail
555560
docker run --rm --platform=linux/arm64 -v "$PWD":/src -w /src debian:stable-slim bash -euxo pipefail -c '
556561
apt-get update
557-
apt-get install -y --no-install-recommends devscripts debhelper dpkg-dev lintian build-essential fakeroot
562+
apt-get install -y --no-install-recommends devscripts debhelper dpkg-dev lintian build-essential sudo fakeroot
558563
chmod +x safexec/helpers/deb.sh
559564
bash safexec/helpers/deb.sh --arch arm64 --version '"${{ steps.ver.outputs.deb }}"'
560565
'

0 commit comments

Comments
 (0)