Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 920691 - dev-qt/qtwebsockets-5.15.11: Cannot run compiler '-g++'
Summary: dev-qt/qtwebsockets-5.15.11: Cannot run compiler '-g++'
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-25 12:55 UTC by Alexey Korepanov
Modified: 2023-12-25 14:08 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,6.99 KB, text/plain)
2023-12-25 12:55 UTC, Alexey Korepanov
Details
environment (environment,97.20 KB, text/plain)
2023-12-25 12:57 UTC, Alexey Korepanov
Details
emerge -pqv (emerge.pqv,83 bytes, text/plain)
2023-12-25 12:57 UTC, Alexey Korepanov
Details
build.log (build.log,3.35 KB, text/x-log)
2023-12-25 13:12 UTC, Alexey Korepanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Korepanov 2023-12-25 12:55:18 UTC
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
Comment 1 Alexey Korepanov 2023-12-25 12:55:53 UTC
Created attachment 880299 [details]
emerge --info
Comment 2 Alexey Korepanov 2023-12-25 12:57:03 UTC
Created attachment 880300 [details]
environment
Comment 3 Alexey Korepanov 2023-12-25 12:57:30 UTC
Created attachment 880301 [details]
emerge -pqv
Comment 4 Alexey Korepanov 2023-12-25 13:03:28 UTC
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"
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-25 13:10:30 UTC
build.log too please
Comment 6 Alexey Korepanov 2023-12-25 13:12:00 UTC
Created attachment 880302 [details]
build.log

oops, how did I miss the build.log
Comment 7 Ionen Wolkens gentoo-dev 2023-12-25 13:22:14 UTC
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.
Comment 8 Ionen Wolkens gentoo-dev 2023-12-25 13:46:06 UTC
(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.
Comment 9 Alexey Korepanov 2023-12-25 14:01:25 UTC
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