Hi3531 Qt5移植

4 篇文章 0 订阅
移植的Qt版本是 5.6.2
因为编译器版本的原因,hi3531-hisiv200支持的最高Qt5的版本是Qt 5.6.2

配置
//5.6 ok
./configure -prefix /usr/local/qt-5.6.2-hisiv200 -release -opensource -confirm-license -c++std c++98 -no-largefile  -no-accessibility  -no-sql-sqlite -no-qml-debug -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -no-harfbuzz -no-openssl -no-libproxy -nomake examples -no-cups -no-tslib -no-icu -no-fontconfig -no-pch -no-dbus -no-use-gold-linker -no-xcb -no-eglfs -no-kms -no-gbm -no-directfb  -no-opengl -no-gstreamer -no-rpath -no-gtkstyle -xplatform linux-arm-hisiv200-g++

编译错误:
obj/release/JSObjectRef.o: In function `JSClassRetain':
JSObjectRef.cpp:(.text+0x88): undefined reference to `__sync_add_and_fetch_4'
obj/release/JSObjectRef.o: In function `JSClassRelease':
JSObjectRef.cpp:(.text+0x520): undefined reference to `__sync_sub_and_fetch_4'
obj/release/JSStringRef.o: In function `JSStringRetain':
JSStringRef.cpp:(.text+0x108): undefined reference to `__sync_add_and_fetch_4'
obj/release/JSStringRef.o: In function `JSStringRelease':
JSStringRef.cpp:(.text+0x2ec): undefined reference to `__sync_sub_and_fetch_4'
obj/release/JSStringRef.o: In function `JSStringIsEqualToUTF8CString':
JSStringRef.cpp:(.text+0x348): undefined reference to `__sync_sub_and_fetch_4'
obj/release/JSValueRef.o: In function `JSValueToStringCopy':
JSValueRef.cpp:(.text+0x1810): undefined reference to `__sync_sub_and_fetch_4'
obj/release/UStringImpl.o: In function `QTWTF::CrossThreadRefCounted<QTWTF::OwnFastMallocPtr<unsigned short> >::deref()':
UStringImpl.cpp:(.text._ZN5QTWTF21CrossThreadRefCountedINS_16OwnFastMallocPtrItEEE5derefEv[QTWTF::CrossThreadRefCounted<QTWTF::OwnFastMallocPtr<unsigned short> >::deref()]+0x28): undefined reference to `__sync_sub_and_fetch_4'
collect2: ld returned 1 exit status
Makefile:666: recipe for target '../../lib/libQt5Script.so.5.6.0' failed
make[3]: *** [../../lib/libQt5Script.so.5.6.0] Error 1
make[3]: Leaving directory '/opt/tools/qt-everywhere-opensource-src-5.6.0/qtscript/src/script'
Makefile:43: recipe for target 'sub-script-make_first-ordered' failed
make[2]: *** [sub-script-make_first-ordered] Error 2
make[2]: Leaving directory '/opt/tools/qt-everywhere-opensource-src-5.6.0/qtscript/src'
Makefile:44: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/opt/tools/qt-everywhere-opensource-src-5.6.0/qtscript'
Makefile:795: recipe for target 'module-qtscript-make_first' failed
make: *** [module-qtscript-make_first] Error 2
root@vmw:/opt/tools/qt-everywhere-opensource-src-5.6.0#
解决方法:
下载gcc-4.4.1源码,解压到/opt/tools/gcc-4.4.1
cd /opt/tools/gcc-4.4.1/gcc/config/arm
libtool --tag=CC --mode=compile arm-hisiv200-linux-gcc -g -O2 -MT linux-atomic.lo -MD -MP -MF linux-atomic.Tpo -c -o linux-atomic.lo linux-atomic.c

libtool --tag=CC --mode=link arm-hisiv200-linux-g++ -g -O2 -o liblinux-atomic.la linux-atomic.lo
生成
/opt/tools/gcc-4.4.1/gcc/config/arm/.libs/liblinux-atomic.a

修改
/opt/tools/qt-everywhere-opensource-src-5.6.2/qtscript/src/script/Makefile
LIBS 最后加上 -L/opt/tools/gcc-4.4.1/gcc/config/arm/.libs -llinux-atomic

参考:

运行程序
# ls /nand/usrtest/qt5 -l
drwxr-xr-x    2 root     root          4096 Jul 14  2017 fonts
-rwxr--r--    1 root     root       6122612 Jul 14  2017 libQt5Core.so.5
-rwxr--r--    1 root     root       4837244 Jul 14  2017 libQt5Gui.so.5
-rwxr--r--    1 root     root       5780464 Jul 14  2017 libQt5Widgets.so.5
drwxr-xr-x   12 root     root          4096 Jul 14  2017 plugins

应用程序修改见相关文档及源码

/nand/usrtest/qt5目录下提前放好相关库文件,plugins及fonts文件
环境变量,QT_QPA_XX字样的是qt5特有的
export LD_LIBRARY_PATH=/nand/usrtest/qt5:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=/nand/usrtest/qt5/plugins
export QT_QPA_FONTDIR=/nand/usrtest/qt5/fonts/
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb1:size=1920x1080:mmSize=1920x1080:offset=0x0:tty=/dev/tty1

程序可以运行,目前有如下问题,待解决。
1) 中文显示,和注释掉的源码,和QTextCodec 有关
//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB2312"));
2)
QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值