diff options
author | Dimitry Andric <dimitry@andric.com> | 2024-12-03 00:31:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 00:31:19 +0100 |
commit | 867a1d621d1c6146dc29fa6b471407327d8f1bff (patch) | |
tree | d1fe332cf9165e3e507366c911cba892a9c93f25 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 5f881b7139bba1b8cd5c09ea021c78b92d1e72c9 (diff) | |
download | llvm-867a1d621d1c6146dc29fa6b471407327d8f1bff.zip llvm-867a1d621d1c6146dc29fa6b471407327d8f1bff.tar.gz llvm-867a1d621d1c6146dc29fa6b471407327d8f1bff.tar.bz2 |
[sanitizer_common] mark __elf_aux_vector as weak on FreeBSD (#118110)
At some point FreeBSD introduced libsys as a wrapper between syscalls
and libc, and then linking sanitized programs started failing with:
```text
# c++ -fsanitize=address main.cc
ld: error: undefined symbol: __elf_aux_vector
>>> referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:950)
>>> sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
```
Mark `__elf_aux_vector` as weak in the internal sanitizer declaration,
so the linker will accept it at link time. The dynamic linker will then
take care of the symbol at run time.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions