Skip to content

Commit 3eef694

Browse files
committed
fix(fuzzer): link Rust Windows dependencies
1 parent 515e5f7 commit 3eef694

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/fuzzer/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ add_custom_target(jazzerjs_libafl_runtime ALL DEPENDS ${RUST_STATICLIB_PATH})
126126
add_dependencies(${PROJECT_NAME} jazzerjs_libafl_runtime)
127127
target_link_libraries(${PROJECT_NAME} ${RUST_STATICLIB_PATH})
128128

129+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
130+
# Rust staticlibs do not propagate Windows import libraries to the final
131+
# Node addon target, so link the system APIs used by Rust std explicitly.
132+
target_link_libraries(${PROJECT_NAME} ntdll ws2_32 userenv)
133+
endif()
134+
129135
# We're not sure why but sometimes systems don't end up setting LLVM_TARGET_TRIPLE used in llvm's cmake to eventually
130136
# set COMPILER_RT_DEFAULT_TARGET which is necessary for compiler-rt to build
131137
# So this will either take it from an envvar or try to set it to a sane value until we can figure out why it's broken

0 commit comments

Comments
 (0)