You are not logged in.

#1 2021-05-26 18:57:24

MrAnderson
Member
Registered: 2018-10-01
Posts: 5

Clang - select different gcc-toolchain

Hello!

I'm struggling a while with clang & gcc. Clang always pick up the latest version of gcc:

clang++ -v
clang version 11.1.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/10.2.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/9.3.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/10.2.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/9.3.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

But I wish it could select version 9.3.0. I was playing with --gcc-toolchain but without success

clang++ --gcc-toolchain=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0 -v        
clang version 11.1.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++ --gcc-toolchain=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0 a.cpp -o a
/usr/bin/ld: cannot find crtbeginS.o: No such file or directory
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

How can I achieve my goal?

Offline

Board footer

Powered by FluxBB