<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65796>65796</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Using clang with `-rtlib=compiler-rt` and sanitizers fails on some Linux distributions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
REmerald
</td>
</tr>
</table>
<pre>
I get the error on Arch Linux and Alpine Linux. See the logs below.
On Debian everything builds fine (tested on clang 14 and 17, same result).
[build-archlinux.log](https://github.com/llvm/llvm-project/files/12563285/build-archlinux.log)
[build-debian.log](https://github.com/llvm/llvm-project/files/12563286/build-debian.log)
The issue seems to be that on Debian clang(?) passes `--as-needed -lgcc_s` to a linker, and on Arch, Alpine and possibly other distros, it does not.
Related to abandoned issue #29055.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysk0GL3DgQhX-NfCm6scuW2z740DO9DQsLC5PkHGSrxlYiS41Knsnk1wepO5NMyCWQi4wL8Z7qe1WK2cyOaBDyTshToba4-DA8_LNSUFYXo9cvw78wU4S4EFAIPoB3cAzTAv8Zt30B5TQc7cU4uhb28I4o37Z-ZhjJ-ue9KE-iPF7P_x2caDTKAT1ReImLcTOMm7Ga4THJCOwicSSdnCar3AxVk32qg8B7YLUSBOLNRoH9G20h77LSToVpsfk51s9CngR2S4wXFvVR4FngeTZx2cb95FeBZ2ufvn92l-A_0RQFnh-NJRZ4rlC2NXZS4Pl34tj_4q1zd3_PuH01_kn51TWf7xcCw7wRMNHKED2MKQQVE8Mb7oxSYCfqs8AeLoqZGERb7naKd45Ik4adnafpI4u2TCIKrHGfKSTsOYFb9un_FnqqXjyzGe0L-LhQAG04Bs_pkomgPTE4H98E9UBWpYSTx6ic9o70rQOBNfallPtCD7Xu614VNFRt32CJVdUVy6APpA5KjtRI7KaWWpr0QdeHRvcSu7YuzIAl1mVfdlXfVLLbV81US12VnTxQ2VMjmpJWZew-kd_7MBfZe2jloW8Lq0aynHcC8UYNBd4LREfP12emijwVYcjZjdvMoimt4cg_NKOJloYPnAb8OsfPJi6ZeIjWjKI-TX69GEthF2JCnmCyciaarxQYHpWxnJizX2_rdYVrxi0a77jYgh3-eL5yA2nAcrvfAgAA__86A0m9">