Comments (6)
I seem to remember that there's no way to explicitly tell the linker that it should do a static build, so one has to get make sure it only finds libyara.a
, not the .dylib
file. The build system for Spyre does this: It builds C dependencies (on MacOSX: OpenSSL, YARA) from source and subsequently gets rid of shared libraries.
(Perhaps this has changed since I last tried, but I can't try since I don't have acces to a MacOSX dev environment at the moment.) The libc
still has to be linked dynamically, there's no supported way to do an entirely static build.
Does this help?
from go-yara.
Thanks for replying!
I am not very experienced with building c libs and deploying them. The go app I build seems to have a hard requirement of loading /usr/local/lib/libyara.8.dylib -- so maybe my question is, is there anything I can change in the build process of the go app that causes it not to expect a .dylib file in /usr/local/lib but instead a libyara.a file next to the built binary ?
I have tried to remove /usr/local/lib/libyara.8.dylib and place libyara.a next to the binary, but it will produce an error : "dyld: Library not loaded: /usr/local/lib/libyara.8.dylib"
otool reports this for my binary
[app] otool -L myapp myapp: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1122.33.0) /usr/local/lib/libyara.8.dylib (compatibility version 9.0.0, current version 9.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1775.118.101) /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59754.100.106)
from go-yara.
Like I said, I don't know how to tell the linker on MacOSX to ignore any shared libraries (*.dylib
). However, if you remove or rename your /usr/local/lib/libyara.8.dylib
so that ld
does not find it when building, it should use libyara.a
instead, resulting in a partially static build.
from go-yara.
@zoid42 Did this help?
from go-yara.
@zoid42 ping?
from go-yara.
No answer -> closing this issue. Feel free to reopen if there are any questions.
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.