<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75651>75651</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OpenMP] asan doesn't work when offload to host
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:openmp
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ye-luo
</td>
</tr>
</table>
<pre>
Currently app doesn't link when OpenMP offload to host and address sanitizer are both turned on.
```
$ clang++ -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu -fsanitize=address main.cpp
/usr/bin/ld: /tmp/main-6e59bc-x86_64-pc-linux-gnu--d95d92.o: in function `asan.module_ctor':
main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0x5): undefined reference to `__asan_init'
/usr/bin/ld: main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0xa): undefined reference to `__asan_version_mismatch_check_v8'
/usr/bin/ld: main.cpp:(.text.asan.module_ctor[asan.module_ctor]+0x24): undefined reference to `__asan_register_elf_globals'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/scratch3/packages/llvm/master-nightly/bin/clang-linker-wrapper: error: 'clang' failed
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
main.cpp
```
int main() {}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lN-OqzYQxp9mcmOBYPiXXHCRNOKuat8AGXsAd42NbJPN9ukrk82es3ta6UjVkbgwYPP9Zvjm496ryRC1UF2guh74Fmbr2jdK9GYPg5Vv7W-bc2SCfmN8XZm05A1gE5hW5oW9zmTYHyuZ3_9kdhy15ZIFy2brA-NGMi6lI--Z50YF9Tc5xh2xwYaZhc0ZksyaFLIrZGeos_frcYslE5qbCfACeGHJaFcyy_qxSAJ3EwUPxfV-rPu6TFaRaGW2ezKZjSXjUxOK6xNj4cqkYl2fEt3mHWA3KAPYaQnFmQF2YVkBu7g3qak6DSL5F4EkkadKnjC18ZQybNyMCMoaBnXGPTfpYuWmqRfBOsAGivND9YOhOAMe00D3kP6wv7r8-OgKeMnuFeApKm5G0qhiBx2N5MgIip2HOuv7eLZXRoWo-9-l_k8S_rMkN3JeWdMvyi88iLkXM4mX_nb8pXhY_iyfo0n5QK4nPfaTtgPX_gPt4cHizMg56-IiGp8cE3ZZosVHrjRJ9qrCzOiuAhNWEssZ4HHzxJJbFPNETJmbFTxaJII96_bCxZ4UgN3KxQufyMcO6NuyezByJUZNc9BvH_3ZmZIHR_Lq-LqS-4QI2LzPTvPO930x-0D9spI-j_GXifv8Upmw_2XAI-CJQXOB5vpl50G2hTwVJ36gNm8yrBus8vIwt4MUp-woeXnMa1kds7qURSPKoSjrscIaD6rFDIsc8wqzosrLVEo51FUty7zKM44IZUYLVzqN3U6tmw7K-43apqqr_KD5QNrvwYj4dMEjegAxhqVr48Fk2CYPZaaVD_7bp4IKeo_VRzpCdWXRbN8F6Kt17wH6JTkPm9PtHMLqd-t3gN2kwrwNqbDLN3Ps4quzf5EIgN3OHr2z4_8TAAD__x2K3_U">