Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix building on apple silicon #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

radkomih
Copy link

Hi, while I was exploring the FuzzyVM I've encountered this error:

./FuzzyVM build

/Users/USER/go/pkg/mod/github.com/ethereum/go-ethereum@v1.11.5/crypto/blake2b/blake2b_f_fuzz.go:43:2: undefined: fSSE4
/Users/USER/go/pkg/mod/github.com/ethereum/go-ethereum@v1.11.5/crypto/blake2b/blake2b_f_fuzz.go:48:2: undefined: fAVX
/Users/USER/go/pkg/mod/github.com/ethereum/go-ethereum@v1.11.5/crypto/blake2b/blake2b_f_fuzz.go:53:2: undefined: fAVX2
typechecking of . failed
exit status 1

I am on Apple Silicon, which is causing the issue so I've included a fix.

@MariusVanDerWijden
Copy link
Owner

Hmm this hardcodes the architecture to arm64, thats not something that we should do

@radkomih
Copy link
Author

radkomih commented Dec 1, 2023

Hmm this hardcodes the architecture to arm64, thats not something that we should do

Yeah, it's ugly, but it was more to illustrate the problem. if you want, I can open an issue?
aslo close this one.

@MariusVanDerWijden
Copy link
Owner

Hmm does compiling FuzzyVM itself work for you? I'm in the process of removing go-fuzz from the codebase in favor of the builtin fuzzer. I also recently updated all dependencies. Could you try to do a go build and report back if that works? If so it will work on m1 once I switched to the builtin fuzzer

@radkomih
Copy link
Author

Hmm does compiling FuzzyVM itself work for you? I'm in the process of removing go-fuzz from the codebase in favor of the builtin fuzzer. I also recently updated all dependencies. Could you try to do a go build and report back if that works? If so it will work on m1 once I switched to the builtin fuzzer

Compiling the old version of FuzzyVM (with go-fuzz) works by providing the GOARCH=amd64 when running ./FuzzyVM build.

Now I've tried to use the most recent changes (without go-fuzz)

go build

it works fine, but I still need to change the GOARCH

GOARCH=amd64 ./FuzzyVM run

otherwise it fails

# github.com/MariusVanDerWijden/FuzzyVM/fuzzer.test
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
0  0x10425af2c  __assert_rtn + 72
1  0x104213a20  ___ZN2ld16LayoutExecutable27writeContentWithoutLinkEditENSt3__14spanIhLm18446744073709551615EEEy_block_invoke_2 + 0
2  0x18d068950  _dispatch_client_callout2 + 20
3  0x18d07bba0  _dispatch_apply_invoke + 176
4  0x18d068910  _dispatch_client_callout + 20
5  0x18d07a3cc  _dispatch_root_queue_drain + 864
6  0x18d07aa04  _dispatch_worker_thread2 + 156
7  0x18d2160d8  _pthread_wqthread + 228
ld: Assertion failed: (addr + content.size() <= sectionEndAddr), function writeContentWithoutLinkEdit_block_invoke, file Layout.cpp, line 5960.
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL	github.com/MariusVanDerWijden/FuzzyVM/fuzzer [build failed]
exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants