From 1e3cb402963d76281119583b1f88583a70f7636a Mon Sep 17 00:00:00 2001 From: David Gidwani Date: Sat, 27 Jan 2024 20:03:02 -0500 Subject: [PATCH] build: :package: add aarch64 support --- .github/workflows/build.yml | 2 +- Dockerfile | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7375422..35d0340 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: policy: ["manylinux2014", "manylinux_2_28", "musllinux_1_1"] - platform: ["x86_64"] + platform: ["x86_64", "aarch64"] env: POLICY: ${{ matrix.policy }} PLATFORM: ${{ matrix.platform }} diff --git a/Dockerfile b/Dockerfile index a800527..4ee7cc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,13 +48,16 @@ RUN cp -r .libs /opt/pcre/ WORKDIR /tmp/vectorscan FROM build_pcre AS build_vectorscan +ARG POLICY +ARG PLATFORM ARG build_type ARG pcre_version RUN mkdir -p build WORKDIR /tmp/vectorscan/build ENV CFLAGS="-fPIC" -RUN [[ "$POLICY" == 'musllinux_1_1' ]] && \ - export CFLAGS="$CFLAGS -march=core2"; \ +RUN if [[ "$POLICY" == 'musllinux_1_1' ]]; then \ + [[ "$PLATFORM" == 'aarch64' ]] && export CFLAGS="$CFLAGS -march=armv8-a" \ + || export CFLAGS="$CFLAGS -march=core2"; fi; \ export CXXFLAGS="$CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"; \ cmake \ -DCMAKE_INSTALL_PREFIX=/opt/vectorscan \