Giter Club home page Giter Club logo

Comments (6)

hillu avatar hillu commented on June 11, 2024

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.

zoid42 avatar zoid42 commented on June 11, 2024

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.

hillu avatar hillu commented on June 11, 2024

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.

hillu avatar hillu commented on June 11, 2024

@zoid42 Did this help?

from go-yara.

hillu avatar hillu commented on June 11, 2024

@zoid42 ping?

from go-yara.

hillu avatar hillu commented on June 11, 2024

No answer -> closing this issue. Feel free to reopen if there are any questions.

from go-yara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.