Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

C/C++ • clang/llvm 20.1.0

$
0
0
Hi Folks,

I've reverted back to the PC from my rpi5 for this for quicker results. Seems GCC_INSTALL_PREFIX has finally been removed and I'm not having any luck figuring out how clang can be pointed at a non-system compiler.

Code:

foo@sdu:~/usr/src/clang$ sd-llvm clang -vclang version 20.1.0Target: x86_64-unknown-linux-gnuThread model: posixInstalledDir: /usr/local/LLVM/20.1.0/binFound candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12Candidate multilib: .;@m64Selected multilib: .;@m64
Supposedly it can be set at runtime..

Code:

foo@sdu:~/usr/src/clang$ sd-llvm clang --gcc-install-dir=/usr/local/gcc -vclang: error: '/usr/local/gcc' does not contain a GCC installationclang version 20.1.0Target: x86_64-unknown-linux-gnuThread model: posixInstalledDir: /usr/local/LLVM/20.1.0/bin
^^^but it does. Okay that's a symlink to "/usr/local/GCC/15.1.0/" but..

Code:

foo@sdu:~/usr/src/clang$ sd-llvm clang --gcc-install-dir=/usr/local/GCC/15.1.0 -vclang: error: '/usr/local/GCC/15.1.0' does not contain a GCC installationclang version 20.1.0Target: x86_64-unknown-linux-gnuThread model: posixInstalledDir: /usr/local/LLVM/20.1.0/bin
..fails also.

I haven't a clue (and google isn't helping) what clang is looking for to select potential candidates.

Code:

foo@sdu:/usr/local/gcc$ cat /usr/local/LLVM/20.1.0/bin/sd-llvm #!/bin/bashPATH=/usr/local/LLVM/20.1.0/bin:$PATH \LD_LIBRARY_PATH=/usr/local/LLVM/20.1.0/lib64:/usr/local/LLVM/20.1.0/lib:/usr/local/LLVM/20.1.0/lib32:/usr/local/gcc/lib64:/usr/local/gcc/lib:/usr/local/gcc/lib32 \MANPATH=/usr/local/LLVM/20.1.0/share/man \INFOPATH=/usr/local/LLVM/20.1.0/share/info \"$@"
I hacked the build such that llvm built against..

Code:

foo@sdu:~/usr/src/clang$ cat z-clang#!/bin/bashclang --gcc-toolchain=/usr/local/gcc "$@"foo@sdu:~/usr/src/clang$ cat z-clang++ #!/bin/bashclang++ --gcc-toolchain=/usr/local/gcc "$@"#for -DCMAKE_C_COMPILER=$PWD/z-clang and -DCMAKE_CXX_COMPILER=$PWD/z-clang++
..in the hope clang would be sane enough to first look at the gcc tools was built against but nope. The llvm git commit makes no sense to me. Sure, override the gcc compiler at runtime but to remove the default gcc it was built against as the default first search seems mad.

I don't actually want to override anything at runtime but if I can't figure out what's going on, then my "QT build" is stuck on the last llvm which supported GCC_INSTALL_PREFIX. I need to be able to specify the gcc at build time and know llvm is not going to take it into its head to go looking elsewhere.

Suggestions?

Statistics: Posted by swampdog — Fri May 16, 2025 6:16 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles