Skip to content

Refactor MinGW build script to use mixed mode paths for CGO and impro… #8

Refactor MinGW build script to use mixed mode paths for CGO and impro…

Refactor MinGW build script to use mixed mode paths for CGO and impro… #8

name: fastfinder_build_linux_arm64
on: [push, pull_request]
jobs:
linux_arm64_build:
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
bison \
flex \
autoconf \
pkg-config \
automake \
libtool \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
qemu-user-static
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.24
- name: Install YARA v4.5.5 (ARM64)
run: |
YARA_VERSION=4.5.5
# Uses previously unpacked source if available, or fetch again
[ -d "/tmp/yara-${YARA_VERSION}" ] || wget --no-verbose -O- https://github.com/VirusTotal/yara/archive/v${YARA_VERSION}.tar.gz | tar -C /tmp -xzf -
cd /tmp/yara-${YARA_VERSION}
make clean || true
./bootstrap.sh
# Build static ARM64 without OpenSSL for simplicity in CI
./configure --host=aarch64-linux-gnu --prefix=/usr/local/aarch64 --enable-static --disable-shared --disable-crypto
make -j$(nproc)
sudo make install
- uses: actions/checkout@v2
- name: Building Fastfinder ARM64
run: |
export CGO_ENABLED=1
export GOOS=linux
export GOARCH=arm64
export CC=aarch64-linux-gnu-gcc
export CGO_CFLAGS="-I/usr/local/aarch64/include"
export CGO_LDFLAGS="-L/usr/local/aarch64/lib -lyara -static"
export PKG_CONFIG_PATH="/usr/local/aarch64/lib/pkgconfig"
go build -trimpath -tags yara_static -a -ldflags '-s -w -extldflags "-static"' -o fastfinder-arm64 .
ls -l fastfinder-arm64
sudo chmod +x fastfinder-arm64
# Verify execution via QEMU
./fastfinder-arm64 -h