External LLVM toolchain not consistently locating c++ when compiling ports
Sid
sid at bsdmail.com
Sun Oct 29 04:45:35 UTC 2017
In /etc/make.conf, when I use,
XCC= /usr/local/bin/clang40
XCXX= /usr/local/bin/clang++40
XCPP= /usr/local/bin/clang-cpp40
for ports that require c++ without clang in the base system, I get the error code
make: "/usr/ports/Mk/Uses/compiler.mk" line 112:warning: "c++ -### /dev/null 2>&1" returned non-zero status
Base and the kernel builds well with this setting. Compiles that don't need c++ also work with this setting.
I've compensated by adding
CC= /usr/local/bin/clang40
CXX= /usr/local/bin/clang++40
CPP= /usr/local/bin/clang-cpp40
to the above. While this works for many ports requiring c++, it doesn't work for Rust, and programs that depend on it (Firefox, Thunderbird).
It seems that XCXX is supposed to replace CXX fully, considering that XCC replaces CC, and XCPP replaces CPP when compiling other ports.
The error message for compiling rust with all of the above (XCC, XCXX, XCPP, CC, CXX, CPP) set is
couldn't find required command: "c++"
This error happens whether the port option for lang/rust is set to compile with llvm40 or the bundled version.
This is affected by /usr/ports/Mk/Uses/compiler.mk and I think this problem affects ports compiled with c++ in the base system as well.
Thank you
More information about the freebsd-toolchain
mailing list