Comments (3)
I resolved the issues with the install command by adding /opt/homebrew/opt/yara/lib/pkgconfig:/opt/homebrew/opt/openssl/lib/pkgconfig
to the PKG_CONFIG_PATH
environment variable.
PKG_CONFIG_PATH=/opt/homebrew/opt/yara/lib/pkgconfig:/opt/homebrew/opt/openssl/lib/pkgconfig go install github.com/hillu/go-yara/v4
You can get away with only adding /opt/homebrew
to the PKG_CONFIG_PATH
as well which begs the question why doesn't pkg-config
look there already?
NOTE: when running my code I'm now getting an error which seems to be a platform related.
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
ld: warning: ignoring file /opt/homebrew/Cellar/yara/4.2.3/lib/libyara.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
from go-yara.
I don't own a Mac, so I can't confirm or test anything.
The linker complaining about files that are not for the correct architecture seems normal.
Is your last error message complete? Seems that there ought to be some more information after "x86_64:".
from go-yara.
@hillu Thanks for the response. I actually figured out this second error as well.
Turns out the error regarding undefined symbols was a result of homebrew installing the amd64
toolchain for go instead of the arm64
toolchain which is correct for an M1 Macbook.
Here's the steps I took to fix this.
- Check which version of go is installed
go env | grep GOARCH
. In my case I got backGOARCH=amd64
which is not correct - If the GOARCH is incorrect you need to uninstall go. See official instructions here
sudo rm -rf /usr/local/go
sudo rm /etc/paths.d/go
- Download and install the correct version of go from the official download page (and don't use homebrew b/c it assumes you want the amd64 version)
CONCLUSION To resolve both errors i've mentioned in this issue.
- Install the correct version of go for my systems architecture
- Install
yara
,pkg-config
andopenssl
through homebrew
brew install yara
brew install pkg-config
brew install openssl
- Use this command during the
go install
step
PKG_CONFIG_PATH=/opt/homebrew/opt/yara/lib/pkgconfig:/opt/homebrew/opt/openssl/lib/pkgconfig go install github.com/hillu/go-yara/v4
NOTE: Go tries to use github.com/hillu/go-yara
as the import but I wanted github.com/hillu/go-yara/v4
since I was using yara 4.2. Just be aware of that because it can make it seem like the libcrypto error never got resolved.
from go-yara.
Related Issues (20)
- There's no way to return an error from MemoryBlockIterator HOT 5
- yr_scanner_scan_file Using mmap is a dangerous operation HOT 9
- Unable to cross compile yara for windows on ubuntu HOT 5
- Is the new tag version expected ? HOT 1
- Issues while installing HOT 7
- Unable to use ScanProc HOT 23
- Unable to define variable on AIX HOT 4
- Scan a file in a streaming maner HOT 2
- Encrypted rules? HOT 4
- unstable rules HOT 5
- Wrong release version? HOT 1
- Building static binary HOT 3
- cannot find -lyara HOT 1
- linux编译yara出现错误 HOT 2
- generate a dynamic-link library (.so file) HOT 1
- v3.x no release tag HOT 1
- Failing to compile with go-yara HOT 9
- yararule.ScanFile, can not scan filepath which contains chinese, may be other language has the same HOT 2
- Attempt to add a new YARA rule files during runtime causes panic HOT 1
- Question: Adding multiple Compiled YARA files to a single yara.Scanner or *yara.Rules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-yara.