-
Notifications
You must be signed in to change notification settings - Fork 28
65 lines (58 loc) · 1.9 KB
/
go_build_windows_386.yml
File metadata and controls
65 lines (58 loc) · 1.9 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
60
61
62
63
64
65
name: fastfinder_build_windows_386
on: [push, pull_request]
jobs:
windows_386_build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
path-type: inherit
update: true
install: >-
mingw-w64-i686-gcc
mingw-w64-i686-toolchain
mingw-w64-i686-pkg-config
mingw-w64-i686-openssl
base-devel
autoconf
automake
libtool
make
unzip
wget
pkg-config
- name: Install YARA v4.5.5 (i386)
run: |
wget -c https://github.com/VirusTotal/yara/archive/refs/tags/v4.5.5.zip -O /tmp/yara.zip
cd /tmp && unzip yara.zip
cd /tmp/yara-4.5.5
./bootstrap.sh
./configure --prefix=/mingw32 --host=i686-w64-mingw32
make -j$(nproc)
make install
# Verify yara.pc installation
ls -la /mingw32/lib/pkgconfig/yara.pc
pkg-config --modversion yara
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.24
- uses: actions/checkout@v2
- name: Build FastFinder (i386)
run: |
# Use MinGW 32-bit environment
export PKG_CONFIG_PATH="/mingw32/lib/pkgconfig:$PKG_CONFIG_PATH"
export CGO_CFLAGS="-I/mingw32/include"
export CGO_ENABLED=1
export GOOS=windows
export GOARCH=386
# Rely on pkg-config for CGO_LDFLAGS like x64 build
# -s -w for stripping, -extldflags "-static" for static linking
go build -v -ldflags "-s -w -extldflags '-static'" -tags yara_static -o fastfinder-386.exe .
ls -l fastfinder-386.exe
./fastfinder-386.exe -h