[clang] [clang][driver] Correcting arguments when using `libFuzzer` with `-shared-libsan` (PR #164842)
Björn Svensson via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 3 00:22:22 PST 2025
================
@@ -43,6 +43,12 @@
// RUN: %clang -fsanitize=fuzzer --target=i386-unknown-linux -stdlib=libc++ -static-libstdc++ %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LIBCXX-STATIC %s
// CHECK-LIBCXX-STATIC: "-Bstatic" "-lc++"
+// Check that we add required sanitizer dependencies when dynamically linking
+// the sanitizer runtime (e.g. libFuzzer uses ceilf in libm).
----------------
bjosv wrote:
`ceilf` was what I got when building without the correction. I can't find it either so can change to `sqrt`.
```
> cd /home/bjorn/repos/llvm-project/build/bin
> ./clang -fsanitize=fuzzer -shared-libsan -Wl,-rpath=$(dirname $(./clang --print-file-name=libclang_rt.ubsan_standalone-x86_64.so)) ~/tmp/test_fuzzer.c
/usr/bin/ld: /home/bjorn/repos/llvm-project/build/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.fuzzer.a(fuzzer.o): undefined reference to symbol 'ceilf@@GLIBC_2.2.5'
```
https://github.com/llvm/llvm-project/pull/164842
More information about the cfe-commits
mailing list