Skip to content
New issue

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

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

Already on GitHub? # to your account

evmone-standalone static library clang build fails while llvm-ar reads mri script #373

Closed
bshastry opened this issue Aug 23, 2021 · 5 comments · Fixed by ethereum/solidity#11938

Comments

@bshastry
Copy link

The Solidity fuzzers on oss-fuzz build evmone static libraries (see https://github.com/google/oss-fuzz/blob/8851460f3d7e712a406909acdf8b3aa2882e011d/projects/solidity/Dockerfile#L56-L61) as part of their base docker image. During a recent update from v0.4.0 -> 0.8.0 (see google/oss-fuzz#6207) it was noticed that evmone-standalone.a build fails (failing log: https://gist.github.com/bshastry/e81e76cc57c393b07accee7599548c88).

The error occurs here

2021-08-23T08:54:56.0397220Z [1/2] Linking CXX static library lib/x86_64-linux-gnu/libevmone-standalone.a
2021-08-23T08:54:56.0470727Z FAILED: : && /usr/local/bin/cmake -E rm -f lib/x86_64-linux-gnu/libevmone-standalone.a && /usr/local/bin/llvm-ar qc lib/x86_64-linux-gnu/libevmone-standalone.a   && /usr/local/bin/llvm-ranlib lib/x86_64-linux-gnu/libevmone-standalone.a && cd /src/evmone/build/lib/evmone && /usr/local/bin/llvm-ar -M < evmone-standalone.mri
2021-08-23T08:54:56.0472769Z /usr/local/bin/llvm-ar: error: script line 1: unknown command: OPEN
2021-08-23T08:54:56.0473431Z ninja: build stopped: subcommand failed.

Sadly, this is stalling Solidity fuzzing :(

Pointers to fix the problem welcome :)

@bshastry bshastry changed the title Evmone static library clang build fails while llvm-ar reads mri script evmone-standalone static library clang build fails while llvm-ar reads mri script Aug 23, 2021
@chfast
Copy link
Member

chfast commented Aug 25, 2021

How do you link it to solidity later? Do you even need evmone-standalone?

@chfast
Copy link
Member

chfast commented Aug 25, 2021

Are you able to test the version in #374?

@bshastry
Copy link
Author

How do you link it to solidity later? Do you even need evmone-standalone?

Like here: https://github.com/ethereum/solidity/blob/69411436139acf5dbcfc5828446f18b9fcfee32c/test/tools/ossfuzz/CMakeLists.txt#L119-L125

Fuzzers require a static library to be linked against because the machines on which fuzzers run may not have dependencies installed. Since evmone v0.4.0, I have been linking evmc and evmone-standalone since I previously ran into linking issues if I only linked evmc.

@bshastry
Copy link
Author

Are you able to test the version in #374?

I can confirm that that PR fixes this issue.

@chfast
Copy link
Member

chfast commented Aug 26, 2021

Fixed in #374, released in 0.8.2.

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

Successfully merging a pull request may close this issue.

2 participants