qt-5.15.0: cross-compile with gcc-4.9
-
Hello, @sonicss !
I pass C++ standart at configure step via-c++std
parameters.
I was have same error#error "Qt requires C++11 support"
, I patch source for fix it$ git diff src/ diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index ebffe74188..0f5e71b4de 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -912,7 +912,7 @@ # define Q_COMPILER_REF_QUALIFIERS # endif # endif -# if Q_CC_GNU >= 500 +# if Q_CC_GNU >= 409 /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */ # define Q_COMPILER_CONSTEXPR
-
@jsulm , why we are can't use GCC-4.9 if
src/corelib/global/qcompilerdetection.h
check many versions of GCC from GCC-4.3? -
@sonicss "Using C++ standard ..................... C++11" - C++11 is already activated. But it looks like you can't build Qt 5.15 with GCC 4.9.
See https://doc.qt.io/qt-5/supported-platforms.html
"Generic Linux x86 and x86_64 GCC (5 or later), ICC 18.x" - looks like you need at least GCC 5. -
Hello, @sonicss !
I pass C++ standart at configure step via-c++std
parameters.
I was have same error#error "Qt requires C++11 support"
, I patch source for fix it$ git diff src/ diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index ebffe74188..0f5e71b4de 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -912,7 +912,7 @@ # define Q_COMPILER_REF_QUALIFIERS # endif # endif -# if Q_CC_GNU >= 500 +# if Q_CC_GNU >= 409 /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */ # define Q_COMPILER_CONSTEXPR
-
@jsulm , now I use Qt-5.12.6 and I try upgrade it to Qt-5.15.0 because it have some important fixes.
@debian I read the file:
qcompilerdetection.h# if Q_CC_GNU >= 500 /* GCC 4.6 introduces constexpr, but it's bugged (at least) in the whole * 4.x series, see e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57694 */ # define Q_COMPILER_CONSTEXPR # endif
I think the new version of qt use constexpr, and the 4.x version of gcc has a bug in it. so can't use the version below 5 of gcc.
-
@sonicss , I think more correct check this at configure stage and why Qt enable different features for different versions of the GCC?
https://github.com/qt/qtbase/blob/5.15.0/src/corelib/global/qcompilerdetection.h#L839
Why minimal version is the GCC-4.3 if I can build Qt only with GCC-5 and above? -
@sonicss , I think more correct check this at configure stage and why Qt enable different features for different versions of the GCC?
https://github.com/qt/qtbase/blob/5.15.0/src/corelib/global/qcompilerdetection.h#L839
Why minimal version is the GCC-4.3 if I can build Qt only with GCC-5 and above?@debian I compared the file (qcompilerdetection.h) in Qt 5.12.8 and Qt5.15.0, the positon of Macro Q_COMPILER_CONSTEXPR is different, so I put this Macro to Q_CC_GNU >= 406, and make the Qt 5.15.0, It still have some errors. But the errors are different.
something like belows:In file included from ../../include/QtCore/qmetatype.h:1:0, from ../../include/QtCore/../../src/corelib/kernel/qobject.h:54, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from global/qt_pch.h:66: ../../include/QtCore/../../src/corelib/kernel/qmetatype.h: In instantiation of 'QtMetaTypePrivate::QSequentialIterableImpl::QSequentialIterableImpl(const T*) [with T = QList<QVariant>]': ../../include/QtCore/../../src/corelib/kernel/qvariant.h:772:139: required from here ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1160:135: error: ambiguous class template instantiation for 'struct QtMetaTypePrivate::ContainerCapabilitiesImpl<QList<QVariant>, void>' , _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities | (1 << 4) | (ContainerCapabilitiesImpl<T>::ContainerCapabilities << (4+3))) ^ In file included from ../../include/QtCore/qmetatype.h:1:0, from ../../include/QtCore/../../src/corelib/kernel/qobject.h:54, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from global/qt_pch.h:66: ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1007:8: error: candidates are: struct QtMetaTypePrivate::ContainerCapabilitiesImpl<Container, decltype (declval<Container>().push_back(declval<typename Container::value_type>()))> struct ContainerCapabilitiesImpl<Container, decltype(std::declval<Container>().push_back(std::declval<typename Container::value_type>()))>
-
ok, I success build with GCC-5.1 http://releases.linaro.org/components/toolchain/binaries/5.1-2015.08/arm-linux-gnueabihf/