I assume by this you mean that there is a folder:
/usr/lib/llvm-19/lib/clang/19/lib/linux/...
I’m on an AArch64 Ubuntu container and if I install using https://apt.llvm.org/ version 19 I see:
$ ls /usr/lib/llvm-19/lib/clang/19/lib/linux/ | grep profile
libclang_rt.profile-aarch64.a
I suspect that what you will see is also libclang_rt.profile-<your host architecture>.a
.
This output can be misleading sometimes because the linker will search multiple places. This is due to changes in layout of these folders over time. For a time it was linux/library-<arch>.a
and then it changed to <arch triple>/library.a
.
Clang will search both / tell lld to search both I think.
Now you might be able to install the AArch64 version of the package alongside the x86 version. I know you can do that with Debian multiarch and gcc packages.
But I don’t want to tell you to do something that might mess up your system as a whole. I’m not sure the packages are designed to be used this way.
A less risky method would be to download the release of 19 that Linaro built (LLVM 19.x Release Third-Party Binaries - #17 by hansw2000) and use that as your clang sysroot and/or pass the lib path with -L
.
(disclosure: I work at Linaro and Omair is one of my colleagues, but you should be aware that it is a third party binary and consider whether that bothers you)
Alternatively you could cross-compile compiler-rt, perhaps using a cross gcc that you can apt install. And again pass that with -L
to the compiler/linker.
I see a gcc-aarch64-linux-gnu
in apt and you can use that to compile just compiler-rt on its own.