Comments (24)
i got it.
to stb_image/Cargo.toml add libfuzzer_no_link_main feature to libafl_targets then it will work
from libafl.
The problem is in libafl_targets. I get the same problem when I try to build it on its own or when trying to build other crates that depend on it (e.g. libafl_frida)
from libafl.
This H file comes from the LLVM includes. By default, they are not added to the INCLUDE path. If I add them using CFLAGS, the compilation fails, as MSVC's cl.exe can't process the LLVM includes. I'd appreciate some help in setting this correctly.
from libafl.
yes i know what causes it. i'll quickly fix
from libafl.
well, the problem i thought was the cause is not related.
how did you install llvm?
from libafl.
I downloaded LLVM-17.0.1-win64.exe from Releases. I first installed it in Program Files. Then I saw that the space in the path causes problems in CFLAGS. So I copied it over to c:\LLVM and updated the PATH. How should the integration between msvc and llvm work?
from libafl.
it's clang that is called from build.rs to compile the stuff not cl.exe
what is the error you saw when you includes the llvm headers?
from libafl.
I can clearly see it is cl.exe that is called. Please see the error print above. When I build libafl_targets by itself, it compiles 4 files (common, coverage, libcmp, windows_asan) using cl.exe and they are compiled successfully. When I build libafl_frida, it tries to build sancov_cmp.c using cl.exe. When I add LLVM headers it produces loads of warnings and errors like:
CFLAGS = Some("-IC:\LLVM\lib\clang\17\include")
running: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-O2" "-Z7" "-Brepro" "-IC:\LLVM\lib\clang\17\include" "-DSANCOV_CMPLOG=1" "-DCMP_MAP_SIZE=65536" "-DAFLPP_CMPLOG_MAP_W=65536" "-DAFLPP_CMPLOG_MAP_H=32" "-DCMPLOG_MAP_W=65536" "-DCMPLOG_MAP_H=32" "-FoC:\LibAFL\fuzzers\frida_libpng\target\release\build\libafl_targets-e5d08c87abdadb46\out\src\sancov_cmp.o" "-c" "src\sancov_cmp.c"
sancov_cmp.c
C:\LLVM\lib\clang\17\include\stdint.h(20): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stdint.h(291): error C2061: syntax error: identifier 'intptr_t'
C:\LLVM\lib\clang\17\include\stdint.h(291): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\stdint.h(298): error C2061: syntax error: identifier 'uintptr_t'
C:\LLVM\lib\clang\17\include\stdint.h(298): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\stdint.h(304): error C2061: syntax error: identifier 'intmax_t'
C:\LLVM\lib\clang\17\include\stdint.h(304): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\stdint.h(305): error C2061: syntax error: identifier 'uintmax_t'
C:\LLVM\lib\clang\17\include\stdint.h(305): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\stddef.h(18): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(30): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(32): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(35): error C2061: syntax error: identifier 'ptrdiff_t'
C:\LLVM\lib\clang\17\include\stddef.h(35): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\stddef.h(41): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(43): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(46): error C2054: expected '(' to follow 'SIZE_TYPE'
C:\LLVM\lib\clang\17\include\stddef.h(55): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(67): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(68): warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\LLVM\lib\clang\17\include\stddef.h(74): error C2085: 'WCHAR_TYPE': not in formal parameter list
C:\LLVM\lib\clang\17\include\stddef.h(74): error C2146: syntax error: missing ',' before identifier 'wchar_t'
C:\LibAFL\libafl_targets\src\cmplog.h(23): error C2061: syntax error: identifier 'uint16_t'
C:\LibAFL\libafl_targets\src\cmplog.h(24): error C2061: syntax error: identifier 'shape'
C:\LibAFL\libafl_targets\src\cmplog.h(24): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(25): error C2061: syntax error: identifier 'kind'
C:\LibAFL\libafl_targets\src\cmplog.h(25): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(26): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(52): error C2061: syntax error: identifier 'uint64_t'
C:\LibAFL\libafl_targets\src\cmplog.h(53): error C2061: syntax error: identifier 'v1'
C:\LibAFL\libafl_targets\src\cmplog.h(53): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(54): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(57): error C2061: syntax error: identifier 'uint8_t'
C:\LibAFL\libafl_targets\src\cmplog.h(58): error C2061: syntax error: identifier 'v1'
C:\LibAFL\libafl_targets\src\cmplog.h(58): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(58): error C2059: syntax error: '['
C:\LibAFL\libafl_targets\src\cmplog.h(59): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(62): error C2061: syntax error: identifier 'CmpLogHeader'
C:\LibAFL\libafl_targets\src\cmplog.h(64): error C2061: syntax error: identifier 'CmpLogInstruction'
C:\LibAFL\libafl_targets\src\cmplog.h(65): error C2061: syntax error: identifier 'routines'
C:\LibAFL\libafl_targets\src\cmplog.h(65): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(65): error C2059: syntax error: '['
C:\LibAFL\libafl_targets\src\cmplog.h(66): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(67): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(72): error C2061: syntax error: identifier 'CmpLogInstruction'
C:\LibAFL\libafl_targets\src\cmplog.h(73): error C2061: syntax error: identifier 'routines'
C:\LibAFL\libafl_targets\src\cmplog.h(73): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(73): error C2059: syntax error: '['
C:\LibAFL\libafl_targets\src\cmplog.h(74): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(75): error C2059: syntax error: '}'
C:\LibAFL\libafl_targets\src\cmplog.h(77): error C2061: syntax error: identifier 'libafl_cmplog_map'
C:\LibAFL\libafl_targets\src\cmplog.h(77): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(78): error C2143: syntax error: missing '{' before ''
C:\LibAFL\libafl_targets\src\cmplog.h(80): error C2061: syntax error: identifier 'libafl_cmplog_map_extended'
C:\LibAFL\libafl_targets\src\cmplog.h(80): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(81): error C2143: syntax error: missing '{' before ''
C:\LibAFL\libafl_targets\src\cmplog.h(83): error C2061: syntax error: identifier 'libafl_cmplog_enabled'
C:\LibAFL\libafl_targets\src\cmplog.h(83): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(85): error C2146: syntax error: missing ')' before identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(85): error C2061: syntax error: identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(85): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(85): error C2059: syntax error: ','
C:\LibAFL\libafl_targets\src\cmplog.h(86): error C2059: syntax error: ')'
C:\LibAFL\libafl_targets\src\cmplog.h(88): error C2146: syntax error: missing ')' before identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(88): error C2061: syntax error: identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(88): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(88): error C2059: syntax error: ','
C:\LibAFL\libafl_targets\src\cmplog.h(89): error C2059: syntax error: ')'
C:\LibAFL\libafl_targets\src\cmplog.h(91): error C2146: syntax error: missing ')' before identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(91): error C2061: syntax error: identifier 'k'
C:\LibAFL\libafl_targets\src\cmplog.h(91): error C2059: syntax error: ';'
C:\LibAFL\libafl_targets\src\cmplog.h(91): error C2059: syntax error: ','
C:\LibAFL\libafl_targets\src\cmplog.h(92): error C2059: syntax error: ')'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(33): error C2061: syntax error: identifier 'intptr_t'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(39): error C2059: syntax error: '}'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(53): error C2143: syntax error: missing ')' before ''
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(53): error C2143: syntax error: missing '{' before ''
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(53): error C2059: syntax error: ')'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(69): error C2061: syntax error: identifier '__sanitizer_unaligned_load16'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(69): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(69): error C2059: syntax error: ''
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(76): error C2061: syntax error: identifier '__sanitizer_unaligned_load32'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(76): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(76): error C2059: syntax error: ''
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(83): error C2061: syntax error: identifier '__sanitizer_unaligned_load64'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(83): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(83): error C2059: syntax error: ''
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(89): error C2146: syntax error: missing ')' before identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(89): error C2081: 'uint16_t': name in formal parameter list illegal
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(89): error C2061: syntax error: identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(89): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(89): error C2059: syntax error: ')'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(95): error C2146: syntax error: missing ')' before identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(95): error C2081: 'uint32_t': name in formal parameter list illegal
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(95): error C2061: syntax error: identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(95): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(95): error C2059: syntax error: ')'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(101): error C2146: syntax error: missing ')' before identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(101): error C2081: 'uint64_t': name in formal parameter list illegal
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(101): error C2061: syntax error: identifier 'x'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(101): error C2059: syntax error: ';'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(101): error C2059: syntax error: ')'
C:\LLVM\lib\clang\17\include\sanitizer/common_interface_defs.h(289): error C2059: syntax error: 'string'
src\sancov_cmp.c(12): error C2146: syntax error: missing ')' before identifier 'arg1'
src\sancov_cmp.c(12): error C2061: syntax error: identifier 'arg1'
src\sancov_cmp.c(12): error C2059: syntax error: ';'
src\sancov_cmp.c(12): error C2059: syntax error: ','
src\sancov_cmp.c(12): error C2059: syntax error: ')'
src\sancov_cmp.c(26): error C2146: syntax error: missing ')' before identifier 'arg1'
src\sancov_cmp.c(26): error C2061: syntax error: identifier 'arg1'
src\sancov_cmp.c(26): fatal error C1003: error count exceeds 100; stopping compilation
exit code: 2
--- stderr
error occurred: Command "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-O2" "-Z7" "-Brepro" "-IC:\LLVM\lib\clang\17\include" "-DSANCOV_CMPLOG=1" "-DCMP_MAP_SIZE=65536" "-DAFLPP_CMPLOG_MAP_W=65536" "-DAFLPP_CMPLOG_MAP_H=32" "-DCMPLOG_MAP_W=65536" "-DCMPLOG_MAP_H=32" "-FoC:\LibAFL\fuzzers\frida_libpng\target\release\build\libafl_targets-e5d08c87abdadb46\out\src\sancov_cmp.o" "-c" "src\sancov_cmp.c" with args "cl.exe" did not execute successfully (status code exit code: 2).
from libafl.
I ran unix2dos on all H files in the LLVM include
from libafl.
i think the problem comes from unix2dos.
why do you need it?
from libafl.
I thought it was needed because of the newlines. But I have reinstalled LLVM and now it has Linux end of lines. Regardless, I see the same behavior - cl.exe is run and not clang. And cl.exe does not like clang's headers. How is it supposed to work? Where should the compiler be selected? Maybe I need to reinstall the cc crate of something like this?
from libafl.
cl.exe is used to compile the llvm pass into a dll
then clang is used to compile the fuzzer libfuzzer_stb_image
which uses the dll that was compiled before.
from libafl.
cl.exe is run and not clang. And cl.exe does not like clang's headers.
if the failure is in libafl_targets then yes it's all about cl.exe
And cl.exe does not like clang's headers.
what's the error if you don't use dos2unix? are you perhaps using cygwin or msys2? If so you should try this with powershell because i never tested this on cygwin or msys2
from libafl.
I'm using the original (not converted) LLVM headers now. They only have \n.
I was indeed compiling in Git Bash. I tried now in Powershell and get exactly the same behavior (not finding the LLVM headers without CFLAGS and failing cl.exe on compiling LLVM headers with CFLAGS):
from libafl.
honestly i don't know what is the cause. libafl_targets
is building in our CI so i think it's something with your setup.
from libafl.
how did you install cl.exe
from libafl.
cl.exe comes from Visual Studio I had installed before installing LLVM.
I want to stress: libaft_targets
builds when I build it on its own. Only when I build libafl_frida
, it builds more files from libaft_targets
and these require LLVM headers
from libafl.
Only when I build libafl_frida, it builds more files from libaft_targets and these require LLVM headers
yes because of common_interface_defs.h which is required by frida build. but that one also works in windows CI.
from libafl.
can you update your visual studio to 2022 and see if it fixes it?
from libafl.
I confirm that installing VS 2022 resolves the compilation issue. VS2022 comes with the required files and we don't need to add external LLVM.
from libafl.
Unfortunately, not everything has been resolved. After updating to VS 2022 libafl_frida
is being built correctly, but libfuzzer_stb_image
is not:
warning: __sanitizer_set_death_callback
redeclared with a different signature
--> C:\LibAFL\libafl_targets\src\windows_asan.rs:15:5
|
15 | fn __sanitizer_set_death_callback(cb: CB);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
|
::: C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out/sanitizer_interfaces.rs:260:5
|
260 | pub fn __sanitizer_set_death_callback(callback: ::core::option::Option<unsafe extern "C" fn()>);
| ----------------------------------------------------------------------------------------------- __sanitizer_set_death_callback
previously declared here
|
= note: expected unsafe extern "C" fn(core::option::Option<unsafe extern "C" fn()>)
found unsafe extern "C" fn(unsafe extern "C" fn())
= note: #[warn(clashing_extern_declarations)]
on by default
warning: libafl_targets
(lib) generated 1 warning
warning: libafl
(lib) generated 1 warning
error: linking with link.exe
failed: exit code: 1120
|
= note: "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64\link.exe" "/NOLOGO" "C:\Users\mkrav\AppData\Local\Temp\rustc2tUhqP\symbols.o" "C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps\libfuzzer_stb_image.libfuzzer_stb_image.50629f7fe474387d-cgu.0.rcgu.o" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libfuzzer_stb_image-0e5ba3b9e0cd37eb\out" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libfuzzer_stb_image-0e5ba3b9e0cd37eb\out" "/LIBPATH:C:\Users\mkrav\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\lib" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libafl_targets-796f3221e0432581\out" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\atlmfc\lib\x64" "/LIBPATH:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\build\libmimalloc-sys-912fc62ed971a7b8\out" "/LIBPATH:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "harness.lib" "C:\Users\mkrav\AppData\Local\Temp\rustc2tUhqP\liblibafl_targets-29d57f53f0080807.rlib" "C:\Users\mkrav\AppData\Local\Temp\rustc2tUhqP\liblibmimalloc_sys-493a7050e04f4994.rlib" "C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-9dbc16e13c04d841.rlib" "kernel32.lib" "windows.0.48.5.lib" "advapi32.lib" "cfgmgr32.lib" "gdi32.lib" "kernel32.lib" "msimg32.lib" "opengl32.lib" "synchronization.lib" "user32.lib" "winspool.lib" "windows.0.48.5.lib" "windows.0.48.5.lib" "bcrypt.lib" "advapi32.lib" "legacy_stdio_definitions.lib" "kernel32.lib" "advapi32.lib" "bcrypt.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "ws2_32.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "/OUT:C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps\libfuzzer_stb_image.exe" "/OPT:REF,ICF" "/DEBUG" "/NATVIS:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\mkrav\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: liblibafl_targets-29d57f53f0080807.rlib(libfuzzer.o) : error LNK2005: main already defined in libfuzzer_stb_image.libfuzzer_stb_image.50629f7fe474387d-cgu.0.rcgu.o
Creating library C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps\libfuzzer_stb_image.lib and object C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps\libfuzzer_stb_image.exp
liblibafl_targets-29d57f53f0080807.rlib(libfuzzer.o) : error LNK2019: unresolved external symbol LLVMFuzzerRunDriver referenced in function main
C:\LibAFL\fuzzers\libfuzzer_stb_image\target\release\deps\libfuzzer_stb_image.exe : fatal error LNK1120: 1 unresolved externals
The following warnings were emitted during compilation:
warning: In file included from ./harness.c:10:
warning: ./stb_image.h:7307:15: warning: variable 'out_size' set but not used [-Wunused-but-set-variable]
warning: 7307 | int out_size = 0;
warning: | ^
warning: ./stb_image.h:7308:15: warning: variable 'delays_size' set but not used [-Wunused-but-set-variable]
warning: 7308 | int delays_size = 0;
warning: | ^
warning: 2 warnings generated.
error: could not compile libfuzzer_stb_image
(bin "libfuzzer_stb_image") due to previous error
from libafl.
i think #981 broke it
from libafl.
can you add "libfuzzer_define_run_driver" to libafl_target's feature in libfuzzer_stb_image/Cargo.toml to see if it is fixed?
from libafl.
Added, but it did not resolve the issue. When I look at the code, I see no implementation of LLVMFuzzerRunDriver in libfuzzer.c of libafl_targets, just its declaration. The linker can't find a library where the function is implemented.
from libafl.
Related Issues (20)
- Shrinking cmplog header HOT 1
- Forkserver Support for Android
- How can I use a dictionary while fuzzing? HOT 3
- Wrong implementation of tmin? HOT 4
- post_run_reset in Executors HOT 6
- Objective Deduplication using the stack/call trace helper for QemuForkExecutor
- Do not use assert! in testcase_score HOT 3
- Why do Observers need to be serializable? HOT 10
- Question: Why TinyInstExecutor's run_target returns without running the target? HOT 7
- Keep non-interesting initial seeds around for Splicing and other things
- Resolve CI instability HOT 3
- x86_64_stub_bindings.rs used for all CPUs in qemu_systemmode HOT 1
- Disabled Testcases for Splicing HOT 2
- Stable-ish State Dump Format for Quck Resume
- libafl_targets: libfuzzer CHECK_WEAK_FN always true on macOS HOT 1
- Persistent mode forkserver child_id is reset to None while the pid is still valid HOT 4
- snapshot in QEMU usermode? HOT 2
- Huge unused macro in anymap HOT 2
- CmpLog and autotokens borrow https://github.com/AFLplusplus/AFLplusplus/issues/1927 from AFL++
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libafl.