Unable to compile 32-bit binaries with clang and ASAN enabled

I have os-core-legacy and c-basic-legacy installed. When compiling a 32-bit executable using clang when ASAN is enabled, it fails to link due to missing libraries. It works fine with GCC.

~> cat empty.c
int main() { return 0; }
~> gcc -m32 -o empty empty.c
~> gcc -m32 -fsanitize=address -o empty empty.c
~> clang -m32 -o empty empty.c
~> clang -m32 -fsanitize=address -o empty empty.c
/usr/bin/ld: cannot find /usr/lib64/clang/19/lib/i386-generic-linux/libclang_rt.asan_static.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib64/clang/19/lib/i386-generic-linux/libclang_rt.asan.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)

try sudo swupd search-file libclang_rt.asan_static.a to see if the required file is available in the swupd repo.

It looks like it only has the 64-bit version of the library:

~> sudo swupd search-file libclang_rt.asan_static.a
Downloading all Clear Linux manifests
 [100%]

Searching for 'libclang_rt.asan_static.a'

Bundle llvm [installed] (6183 MB on system)
	/usr/lib64/clang/19/lib/x86_64-generic-linux/libclang_rt.asan_static.a

I guess this might be my cue to migrate my GitHub runners to a Docker container :wink:

our clang support for 32 bit like this is … non existent since we haven’t had any need for it.

if this is something that is actually useful let us know and we can see what we can do

I mainly using it just to check the software I’m writing works properly on 32-bit platforms. I can understand why this is not a priority to support since 32-bit x86 is very obsolete now. At least I can still use GCC for this which is working fine and I can either disable clang or disable ASAN for clang on 32-bit builds, or migrate it to Debian running in a container.