-
Notifications
You must be signed in to change notification settings - Fork 28
59 lines (51 loc) · 1.96 KB
/
go_build_linux_arm64.yml
File metadata and controls
59 lines (51 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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