Solved Windows Cross compile for Raspberry Pi 3 make && install error
-
Hi I follow the instruction of this topic a tutoriel for cross-compilation and i use this configure command line:
../qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-rpi3-g++ -sysroot C:/SysGcc/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -qt-xcb
and everything got fine, but when i make i have this error.
Error I got:
In file included from C:/SystGcc/qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/config.h:26:0,
from C:/SystGcc/qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp:44:
C:/SystGcc/qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h:370:6: error: #error "Not supported ARM architecture"
-# error "Not supported ARM architecture"
^
C:/SystGcc/qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp: In function 'JSRegExp* jsRegExpCompile(const UChar*, int, JSRegExpIgnoreCaseOption, JSRegExpMultilineOption, unsigned int*, const char**)':
C:/SystGcc/qt-everywhere-opensource-src-5.8.0/qt-everywhere-opensource-src-5.8.0/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp:2590:62: warning: cast from 'char*' to 'JSRegExp*' increases required alignment of target type [-Wcast-align]
JSRegExp* re = reinterpret_cast<JSRegExp*>(new char[size]);
^
make[3]: *** [Makefile:2452: obj/release/pcre_compile.obj] Error 1
make[3]: Leaving directory '/c/SystGcc/qt-build/qtscript/src/script'
make[2]: *** [Makefile:68: sub-script-install_subtargets-ordered] Error 2
make[2]: Leaving directory '/c/SystGcc/qt-build/qtscript/src'
make[1]: *** [Makefile:57: sub-src-install_subtargets] Error 2
make[1]: Leaving directory '/c/SystGcc/qt-build/qtscript'
make: *** [Makefile:1006: module-qtscript-install_subtargets] Error 2if you can help me to know what it's the problemes and how to fix it it's very appreciate.
thanks for your anwser -
Hi and welcome to devnet,
Looks like the backend of qtscript doesn't like ARM but in any case, that module has been deprecated in 5.5 and removed in 5.6 so the best course of action in your case is to just not build it.
-
@SGaist thanks but i found the solution the last post of this topic explain how to fix it. I found the rigth folder in qt-everywhere-opensource-src-5.8.0\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\wtf\platform.h(that for my case it can change in your case but you need to find this .h). In this folder searchfor this ARM_ARCH_5TEJ. A little tips use note pad with crtl+f.You should find all other ARM define now you must know what it's your Arm architecture. to know your Arm on your Raspberry Pi enter this command on the terminal cat /proc/cpuinfo. I take the X__ARM_ARCH_7M__X(don't take X) and add in my configure commande -D__ARM_ARCH_7M__ and it work
-
While it's a good news from a build point of view and thanks for sharing your findings, please keep in mind that the module has been obsoleted.
-
@SGaist do you know how to skip it ?
-
Either on the config line or by delete/moving the sources of the module.
-
@SGaist the module that you talk about it's qtscript or it's ARM? that not clear for me.
-
qtscript
ARM is an architecture
-
Just for the sake of completeness, this simple patch enables building qt5script v5.12.7 on Raspberry Pi 3:
diff –git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h index a4695a2..897c90c 100644 — a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h @@ -306,6 +306,9 @@ || defined(ARM_ARCH_7R) #define WTF_ARM_ARCH_VERSION 7 +#elif defined(ARM_ARCH_8A) +#define WTF_ARM_ARCH_VERSION 8 + /* RVCT sets _TARGET_ARCH_ARM */ #elif defined(__TARGET_ARCH_ARM) #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM
Similar patches should work on other Qt versions.
Credits go to http://lists.buildroot.org/pipermail/buildroot/2017-August/200515.html, http://lists.buildroot.org/pipermail/buildroot/2017-August/200520.html