Hi. I can't get dev-qt/qtwebsockets and some other qt packages to build, for example dev-qt/linguist-tools or dev-qt/qtxmlpatterns. This happens on a box where clang is the default compiler, and to fall back to gcc, where clang fails, I use and portage env file which sets CXX=g++ and similar. The compilation fails with >>> Configuring source in /var/tmp/portage/dev-qt/qtwebsockets-5.15.11/work/qtwebsockets-everywhere-src-5.15.11 ... * Running qt5_qmake Project ERROR: Cannot run compiler '-g++'. Output: regardless of whether I use a fallback to gcc or I'm trying to compile with clang. I found a bug which may be related: https://bugs.gentoo.org/717680 I also asked a question on gentoo forums: https://forums.gentoo.org/viewtopic-p-8811012.html Will upload details in a second. Reproducible: Always
Created attachment 880299 [details] emerge --info
Created attachment 880300 [details] environment
Created attachment 880301 [details] emerge -pqv
relevant part of make.conf: COMMON_FLAGS="-O2 -pipe -march=native" CFLAGS="${COMMON_FLAGS} -flto=thin" CXXFLAGS="${COMMON_FLAGS} -flto=thin" FCFLAGS="${COMMON_FLAGS} -flto" FFLAGS="${COMMON_FLAGS} -flto" RUSTFLAGS="-C target-cpu=native" # LLVM LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed -fuse-ld=lld" CC="clang" CXX="clang++" AR="llvm-ar" NM="llvm-nm" RANLIB="llvm-ranlib" gcc fallback: # cat /etc/portage/env/gcc-nolto.conf CC="gcc" CXX="g++" CPP="cpp" AR="ar" NM="nm" RANLIB="ranlib" COMMON_FLAGS="-O2 -pipe -march=native" CFLAGS="${COMMON_FLAGS}" CXXFLAGS="${COMMON_FLAGS}" FCFLAGS="${COMMON_FLAGS}" FFLAGS="${COMMON_FLAGS}" LDFLAGS="-Wl,--as-needed"
build.log too please
Created attachment 880302 [details] build.log oops, how did I miss the build.log
While the build itself respect CXX, qmake probes the compiler it was built with for information while ignoring it. Can sometime result in weirdness if switching back & forth between g++ and clang++ and it doesn't match what qmake thinks you're using anymore. May also have recorded a bad value somehow (dash in front?) when dev-qt/qtcore was built. Haven't looked closely for more insight, but qtcore is the package you want to look at / rebuild for what may be wrong.
(In reply to Ionen Wolkens from comment #7) > May also have recorded a bad value somehow (dash in front?) when > dev-qt/qtcore was built. Interestingly, building qtcore with CXX=-g++ does not fail (seems it fallbacks to g++). But then it records that value and other packages fail. Assume something like that happened here, maybe you had something like CXX=${unset}-g++ somewhere.
Many thanks for the advice. I've rebuilt the qtcore; moreover now I was even able to do it with clang (although without lto). Recently this wasn't working. With the updated qtcore, other qt packages recompiled with no errors, both with gcc and clang. I am not sure where `-g++` comes from, but when things were not compiling I tried things like `CXX="${CHOST}-g++"` in the gcc fallback file, and I may have easily screwed something up. Anyway, huge thanks. I didn't figure out that `-g++` comes from how qtcore was built, and I was stuck on this error for a few weeks