Skip to content

Commit 060f987

Browse files
authored
test: fix toolchain for arm64 hosts (#806)
* test: fix toolchain for arm64 hosts On arm64 hosts lld-link seems to default to /machine:ARM64 which is incorrect for the cross-compile u se-case. Set the machine type to x64. * test: use abort() to fake a crash __builtin_trap() is caught on ARM64 such that the fuzzing engine cannot act anymore. Use abort() to cause an abnormal program termination.
1 parent 6d9c7cb commit 060f987

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/cpp/workspace/clang-cl/toolchain.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ find_program(CMAKE_CXX_COMPILER NAMES clang-cl REQUIRED)
1919
find_program(CMAKE_AR NAMES llvm-lib REQUIRED)
2020

2121
add_compile_options(--target=x86_64-pc-windows-msvc -fuse-ld=lld /winsdkdir ${WINDOWS_SDK_ROOT}/sdk /vctoolsdir ${WINDOWS_SDK_ROOT}/crt)
22-
add_link_options(/manifest:no -libpath:${WINDOWS_SDK_ROOT}/sdk/lib/um/x64 -libpath:${WINDOWS_SDK_ROOT}/sdk/lib/ucrt/x64 -libpath:${WINDOWS_SDK_ROOT}/crt/lib/x64)
22+
add_link_options(/machine:x64 /manifest:no -libpath:${WINDOWS_SDK_ROOT}/sdk/lib/um/x64 -libpath:${WINDOWS_SDK_ROOT}/sdk/lib/ucrt/x64 -libpath:${WINDOWS_SDK_ROOT}/crt/lib/x64)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#include <cstdint>
2+
#include <cstdlib>
23

34
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, std::size_t size)
45
{
56
if (size > 0 && data[0] == 'H')
67
if (size > 1 && data[1] == 'I')
7-
__builtin_trap();
8+
abort();
89

910
return 0;
1011
}

0 commit comments

Comments
 (0)