Coder Social home page Coder Social logo

Make the build chain work on OSX about spyre HOT 4 CLOSED

rhaist avatar rhaist commented on August 12, 2024
Make the build chain work on OSX

from spyre.

Comments (4)

hillu avatar hillu commented on August 12, 2024

You should not need to install openssl via homebrew because as a build-dependency of YARA, it is supposed to be built using the rules in 3rdparty.mk.

from spyre.

hillu avatar hillu commented on August 12, 2024

Sadly, I don't have access to a MacOSX build environment (and I don't want to do the edit-compile-rinse-repeat dance through a CI service). I am currently working on getting Spyre to build on FreeBSD. This is all about the 3rdparty libraries and most of this stuff can probably be transferred to MacOSX.

from spyre.

n3x77 avatar n3x77 commented on August 12, 2024

Hi after first testing there are some issues with static builds on MacOS:

[+] Building spyre...
[+] GOROOT=/usr/local/opt/go/libexec GOOS=darwin GOARCH=amd64 CC=cc
[+] PKG_CONFIG_PATH=/Users/n3x77/git/spyre/_3rdparty/tgt/x86_64-apple-darwin19.6.0/lib/pkgconfig
mkdir -p _build/x86_64-apple-darwin19.6.0
/usr/local/opt/go/libexec/bin/go build \
        -ldflags '-w -s -linkmode=external -extldflags "-static"' \
        -tags yara_static \
        -o _build/x86_64-apple-darwin19.6.0/spyre github.com/spyre-project/spyre/cmd/spyre
go: github.com/hillu/[email protected]: Get "https://proxy.golang.org/github.com/hillu/go-archive-zip-crypto/@v/v0.0.0-20200712202847-bd5cf365dd44.mod": dial tcp 216.58.208.49:443: i/o timeout
gmake: *** [Makefile:100: _build/x86_64-apple-darwin19.6.0/spyre] Error 1

 ~/git/spyre  master !1 ?1  gmake                                                                                                                                                          2 ✘  8m 19s
sed: 1: "/var version/{ s/.*"\(. ...": extra characters at the end of p command
[+] Building spyre...
[+] GOROOT=/usr/local/opt/go/libexec GOOS=darwin GOARCH=amd64 CC=cc
[+] PKG_CONFIG_PATH=/Users/n3x77/git/spyre/_3rdparty/tgt/x86_64-apple-darwin19.6.0/lib/pkgconfig
mkdir -p _build/x86_64-apple-darwin19.6.0
/usr/local/opt/go/libexec/bin/go build \
        -ldflags '-w -s -linkmode=external -extldflags "-static"' \
        -tags yara_static \
        -o _build/x86_64-apple-darwin19.6.0/spyre github.com/spyre-project/spyre/cmd/spyre
go: downloading github.com/mitchellh/go-ps v1.0.0
go: downloading github.com/spf13/afero v1.3.2
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/hillu/go-archive-zip-crypto v0.0.0-20200712202847-bd5cf365dd44
go: downloading github.com/hillu/go-yara/v4 v4.0.2
go: downloading golang.org/x/text v0.3.0
go: downloading golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
# github.com/spyre-project/spyre/cmd/spyre
/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

gmake: *** [Makefile:100: _build/x86_64-apple-darwin19.6.0/spyre] Error 2`

This maybe related to this post, of course we want to have a static build of spyre:

https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag.

I'm currently investigating if this works: https://dropline.net/2015/10/static-linking-on-mac-os-x/

from spyre.

hillu avatar hillu commented on August 12, 2024

Fixed via 797d6ed; Thanks to @n3x77 for testing.

from spyre.

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.