<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115599>115599</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang for sanitizes dynamic libasan support seems missing
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
akhileshkumar80
</td>
</tr>
</table>
<pre>
Hello
Ubuntu clang version 18.1.3 (1ubuntu1)
$ clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
$ clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc -static-libsan -o a.out.static
dongkyun@SDK:~/tmp/asan/clang$ ll
-rwxr-xr-x 1 root root 1663576 Oct 30 14:14 a.out.static
-rwxr-xr-x 1 root root 1663576 Oct 30 14:13 a.out
in case of default compilation observed only static libs are linked, is this normal behavior or bug please guide ?
even i observed the same clang older versions too.
"/usr/bin/ld" -pie -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out.static /lib/x86_64-linux-gnu/Scrt1.o /lib/x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/11 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/usr/lib/llvm-14/bin/../lib -L/lib -L/usr/lib --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_static-x86_64.a --no-whole-archive --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan-x86_64.a.syms --whole-archive /usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a --no-whole-archive --dynamic-list=/usr/lib/llvm-14/lib/clang/14.0.0/lib/linux/libclang_rt.asan_cxx-x86_64.a.syms /tmp/use_after_free-47420a.o -lstdc++ -lm --no-as-needed -lpthread -lrt -lm -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/11/crtendS.o /lib/x86_64-linux-gnu/crtn.o
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVkuPozgQ_jXOpWQLG5KQA4eebaGVdqU5tOYcGVyAt42NbJNJ5rC_fUVMPybb0yPNqrVS5ICpr756fH7IEHRvESuy_US29xs5x8H5Sj4O2mAYHudR-jLbNE5dqt_RGAckuyfZXRq_NLONM7RG2h5O6IN2FnjJOMuBiJLP1--ciMOKEkUyJuITEZ-AfuZAe6BdkFZH_Q1Jfi-V8hgC0M466kYdaefliHRy2kb0gGc5TgaPXwLedRF97RFZ2344AdAQZdQtNboJ0gJ1IJmbI0vTiV852z9eZkuK7OH-D5Lf_U1EHceJiFoGaYmo1-gKMCZBqP969nT5AQfvXEwD3-3y7X4Hn9sIeQa8IPkdL96g_AEe3vaQJw-vm6gttDIguA4UdnI2EVo3TtrIuLTTNQH9CRU4ay6QmGGpAUiPYLR9REXEb6ADxEEHsM6P0kCDgzxp58F5aOYeJoMLST9rhUDyOnHjCS3oF444IAQ54iopZxT6J2EFiM6x7_QHRAgi6jl4IupGL_U1iggBdNII9Bt4NN4BpYMMAw3xYhYB9HYGSptZG0W1AkpxWCUwKA90BDTd8VzujrsCqLpYOV67bh_Rw8Kgm11xZVom5zM9lzu6K1hwTNyqYrUnok7-VkRvZyLqh9ZHzty7Nq2POpm8TpKxZ0zftm8jOU_wBnttH5gD-ucveflV3JPhzXCtXvL5dtKvv90iUhTv4V5bvIc25jRSXvwrp2f2GwhQ-nVwBqn07aBPCD_0l97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