After some research i found that clang tries to open /opt/amdgpu/lib64/libLLVM-17.so
(base) [robos@localhost ~]$ strace /usr/bin/clang
execve("/usr/bin/clang", ["/usr/bin/clang"], 0x7ffcc7b4f090 /* 69 vars */) = 0
brk(NULL) = 0x197c000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc105ec6d0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=84871, ...}) = 0
mmap(NULL, 84871, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa5bfc42000
close(3) = 0
openat(AT_FDCWD, "/lib64/libclang-cpp.so.17", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=69576544, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa5bfc40000
mmap(NULL, 68801408, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa5bba00000
mmap(0x7fa5bc19f000, 47874048, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x79f000) = 0x7fa5bc19f000
mmap(0x7fa5bef47000, 10309632, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3547000) = 0x7fa5bef47000
mmap(0x7fa5bf91c000, 2564096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3f1b000) = 0x7fa5bf91c000
mmap(0x7fa5bfb8e000, 62336, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa5bfb8e000
close(3) = 0
openat(AT_FDCWD, "/opt/amdgpu/lib64/libLLVM-17.so", O_RDONLY|O_CLOEXEC) = 3
...
which in turn is defined in /etc/ld.so.cache
(no need to set LD_LIBRARY_PRELOAD
any value)
(base) [robos@localhost ~]$ strings /etc/ld.so.cache | grep LLVM
/lib/libLLVM-17.so
/opt/amdgpu/lib64/libLLVM-17.so
That concludes my problem for the most part, but I’m still not sure how i was able to compile other programms (maybe they didn’t use clang). And also maybe there’s a way to proiritize /lib64/
instead of /opt/amdgpu/lib64/