Skip to content

Commit 2b22dd5

Browse files
committed
Refactor MinGW build script to use mixed mode paths for CGO and improve static linking
1 parent 7419d84 commit 2b22dd5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/go_build_windows_386.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,22 @@ jobs:
5050
# Use MinGW 32-bit environment
5151
export PATH="/mingw32/bin:$PATH"
5252
export PKG_CONFIG_PATH="/mingw32/lib/pkgconfig"
53-
export CGO_CFLAGS="-I/mingw32/include"
53+
54+
# Convert paths to mixed mode (Windows style with forward slashes) for CGO
55+
_INCLUDE_PATH=$(cygpath -m /mingw32/include)
56+
_LIB_PATH=$(cygpath -m /mingw32/lib)
57+
58+
export CGO_CFLAGS="-I${_INCLUDE_PATH}"
5459
5560
export CGO_ENABLED=1
5661
export GOOS=windows
5762
export GOARCH=386
58-
# Force static linking for MinGW-w64
59-
export CGO_LDFLAGS="-L/mingw32/lib -lyara -lws2_32 -limagehlp -static"
63+
64+
# Check if library exists
65+
ls -l /mingw32/lib/libyara.a
66+
67+
# Force static linking for MinGW-w64 with full paths
68+
export CGO_LDFLAGS="-L${_LIB_PATH} -lyara -lws2_32 -limagehlp -static"
6069
6170
go build -v -ldflags "-s -w -extldflags '-static'" -tags yara_static,yara_no_pkg_config -o fastfinder-386.exe .
6271
ls -l fastfinder-386.exe

0 commit comments

Comments
 (0)