Important: Please read the Qt Code of Conduct -

Solved: Qt 5.11+ fails to configure in Gentoo Prefix with Could not find qmake spec ''.

  • Hello everyone,

    I've been fighting this issue for a week with no real advancements. I've reported in the Gentoo bugtracker the issue:
    I've also started a thread in the Gentoo forums:

    And I've been asking for help on different IRC channels, but for now, even with the help of some fantastic people, I'm still blocked.

    I'm trying to compile qtcore 5.11 (or greater). I can compile qtcore 5.9.6. I'm doing all this in a docker environment (a base Ubuntu 16.04 image, with a Gentoo Prefix bootstrapped system on top).

    The specific problem that arises is that, after bootstrapping qmake successfully, qmake is called. In 5.9.6, this just works, it catches the working folder as the project and goes happily and compiles. In 5.11+, I get the Could not find qmake spec ''. error.

    I've been following the rabbit hole to see what is this spec, and what other variables are involved. The furthest I've got is to appreciate the differences in between 5.9.6 and 5.11.

    On 5.9.6 my debug prints show the following variables from qmake/library/qmakeevaluator.cpp:

    DEBUG QMakeEvaluator::updateMkspecPaths m_buildRoot path '/home/user/gentoo/var/tmp/portage/dev-qt/qtcore-5.9.6/work/qtbase-opensource-src-5.9.6' 
    DEBUG QMakeEvaluator::updateMkspecPaths QT_HOST_DATA/get path '/home/user/gentoo/var/tmp/portage/dev-qt/qtcore-5.9.6/work/qtbase-opensource-src-5.9.6' 
    DEBUG QMakeEvaluator::updateMkspecPaths QT_HOST_DATA/src path '/home/user/gentoo/var/tmp/portage/dev-qt/qtcore-5.9.6/work/qtbase-opensource-src-5.9.6'

    And on 5.11:

    DEBUG QMakeEvaluator::updateMkspecPaths QT_HOST_DATA/get path '/home/user/gentoo/var/tmp/portage/dev-qt/qtcore-5.11.2-r1/work/qtbase-everywhere-src-5.11.2/bin' 
    DEBUG QMakeEvaluator::updateMkspecPaths QT_HOST_DATA/src path '/home/user/gentoo/var/tmp/portage/dev-qt/qtcore-5.11.2-r1/work/qtbase-everywhere-src-5.11.2/bin'

    I notice the path in 5.11.2 is wrong somehow. It points to the bin folder where the qmake binary is placed, instead of the previous folder (where the specs can be found).

    My biggest issue is... I don't know where any of these internal QT variables are set. I've grepped all over and tried to follow the code to know where it comes from with no luck.

    Could anyone give me some ideas?

    P.S.: If anyone wants to reproduce the error, in the Gentoo Forum post there are instructions on how to pull the docker image that reproduces the problem and run it. It may be a bit cumbersome to understand what is going on not being familiar with Gentoo, but I'm very eager to help.
    P.S.2: I've tried up to qtcore 5.11.3 which is the latest version available right now for Gentoo, and all the versions end up with the same problem.

  • I found a fix!

    As reported in:

    I found out if I used the Gentoo Prefix deployed in a host directly the compilation went thru. Which was very suspicious, extra googling ended up in:


    Which, mainly, it's a problem of libseccomp being outdated. Or Docker being outdated. Or both. Anyways, for me it works to use the workaround:

    Run docker (when building QT) with:

    --security-opt seccomp:unconfined

    Ideally libseccomp will be updated sometime in Ubuntu 16.04 and this won't happen again.

    Sorry for the noise.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Glad you found a solution and thanks for sharing it !

    Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

Log in to reply