#1133421 clang: sanitizers are not available (libclang_rt.asan.a: No such file or directory)

Package:
clang
Source:
clang
Description:
C, C++ and Objective-C compiler (LLVM based), clang binary
Submitter:
Marius Mikucionis
Date:
2026-04-13 10:49:19 UTC
Severity:
normal
#1133421#5
Date:
2026-04-13 10:47:44 UTC
From:
To:
Dear Maintainer,

I am trying to use sanitizers (undefined, address, leak) and none of them work with clang/clang++ (versions 21 and 19).

Example program hello.c:
```c
#include <stdio.h>
int main(){}
```

Compile:

$ clang -fsanitize=undefined hello.c
/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find /usr/lib/llvm-21/lib/clang/21/lib/x86_64-pc-linux-gnu/libclang_rt.ubsan_standalone.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ clang -fsanitize=address hello.c
/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find /usr/lib/llvm-21/lib/clang/21/lib/x86_64-pc-linux-gnu/libclang_rt.asan_static.a: No such file or directory
/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find /usr/lib/llvm-21/lib/clang/21/lib/x86_64-pc-linux-gnu/libclang_rt.asan.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ clang -fsanitize=leak hello.c
/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find /usr/lib/llvm-21/lib/clang/21/lib/x86_64-pc-linux-gnu/libclang_rt.lsan.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Same with clang-19 (except that it is looking into /usr/lib/llvm-19 instead /usr/lib/llvm-21).
I could not find such files neither on my system nor in packages.debian.org.

I have libasan8=16-20260322-1 installed but it's probably not usable by clang-19 and clang-21.

I looked at clang-17 and it works.

Bug #819762 seems related, but it's from 2016 and for very old clang version.

Best regards,
Marius

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***