Skip to content

Commit 24e081c

Browse files
committed
cmake: fix libFuzzer library name
The libFuzzer file in OSS Fuzz has a non-standard filename, the patch fixes search of the library in the OSS Fuzz environment. Needed for google/oss-fuzz#14656
1 parent 9c675d4 commit 24e081c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/LibFuzzer.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ function(SetLibFuzzerPath outvar)
2020
endif ()
2121

2222
SetHwArchString(HW_ARCH)
23-
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
23+
# LibFuzzer library in the OSS Fuzz environment has another name.
24+
if (OSS_FUZZ)
25+
set(lib_name "libclang_rt.fuzzer_no_main.a")
26+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
2427
set(lib_name "libclang_rt.fuzzer_no_main-${HW_ARCH}.a")
2528
else()
2629
message(FATAL_ERROR "Unsupported system: ${CMAKE_SYSTEM_NAME}")

0 commit comments

Comments
 (0)