Patch by David CARLIER
Details
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
lib/fuzzer/FuzzerUtilPosix.cpp | ||
---|---|---|
121 | Please add || LIBFUZZER_NETBSD too. |
Sorry for late reply.
In my FreeBSD machines I m unable to build the clang target (linkage ... machine hanging) but all the rest does (e.g. I m able on Linux with similar hw). I tried the patch on libfuzzer alone (with h2o) and seemed working ok.
lib/fuzzer/tests/CMakeLists.txt | ||
---|---|---|
18 | Why -lpthread here? Is it needed for a particular test only? Or all of them? Maybe this should be moved to the clang frontend. |
lib/fuzzer/build.sh | ||
---|---|---|
1 | This is necessary, better to rewrite it to /bin/sh (POSIX shell) if possible. The env fallback is usually good enough for scripts with bash-specific features. There is no bash in the basesystem of BSD. It can be installed optionally and if so, it's located in a different location dedicated for external software - in the NetBSD case, it's /usr/pkg/bin/bash. |
With this change (alongside with this one https://reviews.llvm.org/D41809) I m finally able to build fuzz binaries.
I got 147 tests but had to disable some.
lib/fuzzer/tests/CMakeLists.txt | ||
---|---|---|
18 | When I did the change I think one test required it indeed but might not be necessary now I ve update the tree locally but still struggle to compile the whole :-) we ll see | |
18 | Yes sure I just feared either it would make the expression too long or ... in case we might need to add later on some FreeBSD specificities. |
test/fuzzer/strcmp.test | ||
---|---|---|
3 | I think that the style is to put UNSUPPORTED after RUN: |
test/fuzzer/strcmp.test | ||
---|---|---|
3 | Oh ok I looked at others and were put first. |
I can land this for you (and for the benefit of NetBSD), assuming that it will be accepted by other developer. Maybe @george.karpenkov can have a look?
@krytarowski CMake changes look good to me, but I'm not the code owner, so probably @kcc (or @morehouse) would have to approve it first.
It's interesting that tests requiring intrinsics instrumentation are failing, is it hard to port those as well? (though that could be done in a separate patch)
lib/fuzzer/build.sh | ||
---|---|---|
1 | I see nothing in this script that requires bash. Maybe just use /bin/sh here? But indeed, /bin/bash is normally only available on Linux. BSDs put it in a ports or pkgsrc specific installation directory, and that directory will be in the user's PATH. Something similar goes for e.g. perl and python, one should *never* use /usr/bin/perl or /usr/bin/python, always /usr/bin/env perl and /usr/bin/env python. |
lib/fuzzer/build.sh | ||
---|---|---|
1 | Can you prepare a patch please? |
lib/fuzzer/build.sh | ||
---|---|---|
1 | Hope it s ok https://reviews.llvm.org/D42008 |
Please add || LIBFUZZER_NETBSD too.