Closed ec1oud closed 5 years ago
And do you know what's the gcc version? (I guess these errors are from the compiler's front-end so using gcc of the same version on another platform could generate the same error output.)
WAG patch... I'll try with CI
That didn't fix it. https://codereview.qt-project.org/#/c/259167/ https://testresults.qt.io/logs/qt/qtbase/412bb999ad0acfc031a4eb88bcbf6d428242959b/LinuxRHEL_7_4x86_64INTEGRITYINTEGRITY_11_04armv7GCCqtci-linux-RHEL-7.4-x86_64-707575Release_DisableTests_OpenGLES2_NoUseGoldLinker/2a48a3b7dcb9652b1532a3ad14de7580b5b9b1ee/build_1555446448/log.txt.gz
googling the error finds stuff like https://stackoverflow.com/questions/50399446/keil-error-28-expression-must-have-a-constant-value
I guess it is rather complaining that the initializers are not compile-time constants. Old C standards required that. So I guess replacing e.g.
void somefunc(int a, int b)
{
struct X = { a, b };
...
}
has to be replaced with series of normal assignments:
void somefunc(int a, int b)
{
struct X;
x.a = a;
x.b = b;
...
}
Whack-a-mole session: https://codereview.qt-project.org/#/c/259167/ There are more errors after I fix some...
According to this, rhel 7.4 should provide gcc 4.8.x.
I was able to get gcc 4.8.1 for Windows and with that MD4C builds fine, if I ignore some warnings, and it passes complete test suite.
The only compile-time error I can get from it is with -ansi -pedantic
because it then C compiler does not support inline
.
Is it possible that your CI machine uses something even older for the ARM build? If so, then I am quite surprised it does not choke anywhere else with Qt sources. C++ did evolved more rapidly in the recent years, right? Or is its code base that much conservative?
Can you check it is not e.g. some kind of mis-configuration or something; e.g. that C++ compiler is newer version then C compiler?
Especially if it is some cross-compiler toolchain, there might be some space for some troubles like that...
Is it really gcc? Isn't it this?
The build log (the 1st link you provided) says the core Qt source codes are compiled with g++
, but MD4C is compiled with a command called cxintarm
. Is this mixing of compilers intended?
See https://github.com/openwebos/qt/blob/master/mkspecs/qws/integrity-arm-cxarm/qmake.conf. I guess it is some completely different compiler. Even if it is what you intend to use, this other compiler should likely be ccintarm
for C code compilation, as cxintarm
seems to be for C++.
Thanks for the PR.
I've updated CMakeFiles.txt to enforce -std=c90
. Hopefully it shall help to avoid regressions with the respect to the Integrity compiler.
I guess it must be GHS. I know it has a reputation for being weird and anachronistic. Qt has needed other patches to support it in the past. You may be right that the C++ compiler might not be the best choice for md4c; but Qt is mostly C++ after all. The build seems to be working now anyway.
From https://testresults.qt.io/logs/qt/qtbase/7e01267e18c12cf19d8cf7487126efeeaeb84b23/LinuxRHEL_7_4x86_64INTEGRITYINTEGRITY_11_04armv7GCCqtci-linux-RHEL-7.4-x86_64-fa00a5Release_DisableTests_OpenGLES2_NoUseGoldLinker/2a48a3b7dcb9652b1532a3ad14de7580b5b9b1ee/build_1555421647/log.txt.gz
Host: os: Linux, osVersion: RHEL_7_4, compiler: GCC, arch: X86_64 Target: os: INTEGRITY, osVersion: INTEGRITY_11_04, compiler: GCC, arch: ARMv7
Maybe making those beg and end arguments const will satisfy it? not sure... and I don't have a development environment for testing, so we'll have to keep trying with the CI system I guess.