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

libafl_libfuzzer_runtime does not compile with Apple's clang on macOS #2190

Open
maxammann opened this issue May 16, 2024 · 8 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@maxammann
Copy link
Collaborator

Describe the bug
I'm using the stock Clang on macOS (likely the cause of this issue).
Compiling libafl_libfuzzer_runtime on macOS fails in the final rust-lld step with:

    Finished `release` profile [optimized + debuginfo] target(s) in 0.16s
rust-lld: error: target/release/libafl_libfuzzer_runtime.a(afl_libfuzzer_runtime-f4e5a11aa5da33a2.afl_libfuzzer_runtime.e93c846f93848154-cgu.0.rcgu.o): not an ELF file

To Reproduce
Steps to reproduce the behavior:

  1. cd LibAFL/libafl_libfuzzer/libafl_libfuzzer_runtime
  2. ./build.sh

Expected behavior
The build should succeed with Apple's clang.

Additional context
I'm investigating further if it works with e.g. Nix Clang. I think LibAFL is not supporting Apple's Clang so we might just close this and the issue would serve as documentation for further users :)

@maxammann maxammann added the bug Something isn't working label May 16, 2024
@maxammann
Copy link
Collaborator Author

same issue for now with Clang 14 from Nix. I don't use homebrew so ideally someone could try to reproduce in their environment.

@domenukk
Copy link
Member

Same error for me on homebrew clang... @sameer did the MacOS integration IIRC

@sameer
Copy link
Contributor

sameer commented May 17, 2024

Took a quick look, build.sh is still Linux-only unfortunately. But it should be possible to mirror what I did in #1711 into this script to make it work for macOS.

@addisoncrump
Copy link
Collaborator

@jasikpark is fixing this. Please do not release 0.13 until we fix this.

@addisoncrump addisoncrump added this to the version 0.13 milestone Jun 12, 2024
@addisoncrump
Copy link
Collaborator

There are new problems on macOS as well -- namely, libafl_main and LLVMFuzzerCustom{Mutator,Crossover} do not appear. @maxammann, are you aware of how to fix this issue? It does not seem to resolve it as expected (these symbols do not even appear in the produced .a files...).

@maxammann
Copy link
Collaborator Author

There are new problems on macOS as well -- namely, libafl_main and LLVMFuzzerCustom{Mutator,Crossover} do not appear. @maxammann, are you aware of how to fix this issue? It does not seem to resolve it as expected (these symbols do not even appear in the produced .a files...).

Not really, sorry!

@sameer
Copy link
Contributor

sameer commented Jun 13, 2024

If it's helpful, I can try to do what I did in #1711 for this build script. Though I won't be able to get to it until Monday/Tuesday if the release is being blocked by this issue.

@addisoncrump
Copy link
Collaborator

@domenukk if you would be willing to release a point release a couple weeks after 0.13.0, please feel free to skip this issue for the .0 release. We'll release a .1 with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants