Building static binary
cyrus-mc opened this issue · 3 comments
cyrus-mc commented
According to the documentation there are two steps required to build statically:
- add build tag
yara_static
- set LDflags to include
extdldflags -static
.
I have set the build tag at the top of the main package as such:
//go:build yara_static
// +build yara_static
package main
import (
...
)
func main() {
...
)
I then invoke go build
with -tags=yara_static
and -ldflags '-s -w -extldflags "-static"'
.
Building results in multiple errors relating to yara.Scanner
, yara.NewCompiler
, etc undefined.
hillu commented
Please tell me the environment you are trying to build go-yara in. Also, provide a complete minimal reproducer program and the exact error messages you are getting.