googleprojectzero / SockFuzzer

Other
356 stars 47 forks source link

An error when building SockFuzzer on Mac #1

Open ycaibb opened 3 years ago

ycaibb commented 3 years ago

Hi, Developers: I encountered an error when building. Does it miss a file? Thank you for your help.

/Users/xx/Documents/tools/SockFuzzer/fuzz/net_fuzzer.cc:29:10: fatal error:
      'fuzzer/FuzzedDataProvider.h' file not found
#include <fuzzer/FuzzedDataProvider.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/net_fuzzer.dir/fuzz/net_fuzzer.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/net_fuzzer.dir/all] Error 2
make: *** [all] Error 2
xsscx commented 3 years ago

Hello -

This project compiles out of the box flawlessly on X86_64 Intel Platforms. I can verify that 100%.

When filing a Bug Report, the Developers will need to know the OS Revision and Hardware, so run uname -a, and consider including a detailed reproduction case to include all the steps you've taken to arrive at your stopping point.

X86 Result: uname -a
Darwin xsss-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
M1 Result: uname -a
Darwin Ds-Mac-mini.local 20.5.0 Darwin Kernel Version 20.5.0: Thu Apr 15 05:31:18 PDT 2021; root:xnu-7195.120.38.111.1~4/RELEASE_ARM64_T8101 arm64

M1 will be a different ball of wax, for example, I'm currently working thru the M1 compile.. here is a snip of what we're working thru for mods...

<built-in>:1:10: fatal error: 'meta_features.h' file not found
#include "meta_features.h"
         ^~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

I uploaded the X86_64 dylib to https://github.com/xsscx/mac-binaries/blob/main/libxnu.dylib

Cheers!

ycaibb commented 3 years ago

Hi, Thank you. Does it miss the file, FuzzedDataProvider.h?

../fuzz/net_fuzzer.cc:29:10: fatal error: 'fuzzer/FuzzedDataProvider.h' file not found
#include <fuzzer/FuzzedDataProvider.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[216/217] Building CXX object CMakeFiles/net_fuzzer.dir/net_fuzzer.pb.cc.o
ninja: build stopped: subcommand failed.
nedwill commented 3 years ago

This is part of newer clang distributions. You can see the included Dockerfile for a way to get a recent clang version.

nedwill commented 3 years ago

@xsscx That meta_features.h is generated at build time using the original XNU build system (running kmk inside third_party/xnu). I just committed the prebuilt meta_features.h for x86_64 for ease of compilation on Linux. To support M1 we'll probably have to add special casing in the build system to use different prebuilt paths once someone generates the relevant AARCH64 files.

I don't have an M1 Mac currently but I think that's a great feature step so I'd love to accept a patch if you manage to get it working before I get to it (so long as you can sign the appropriate copyright CLA, etc.).

nedwill commented 2 years ago

I got an M1 Max Macbook Pro so I'll be able to work on builds for both architectures on Mac in the new year.