Results 1 to 2 of 2

Thread: Qt compile for Xilinx Zynq fails -- errors in building moc and rcc tools and corelibs

  1. #1
    Join Date
    Apr 2016
    Posts
    5
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt compile for Xilinx Zynq fails -- errors in building moc and rcc tools and corelibs

    I am trying to compile Qt to use it with tslib and PetaLinux to be used on Xilinx Zynq development board (per http://blog.idv-tech.com/2014/10/15/...m-xilinx-zynq/)
    However, after I run configuration and then run gmake, it error out on compilation of moc tool.

    Here are configuration options which I used before making Qt.
    Qt Code:
    1. export ZYNQ_QT_BUILD=/home/adzh/Projects
    2. export ZYNQ_QT_INSTALL=/opt/Qt_Xilinx/5.6
    3. export PATH=$ZYNQ_QT_INSTALL/bin:$PATH
    4. export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
    5. source ~/opt/Xilinx/Vivado/2015.2/settings64.sh
    6.  
    7. ./configure -prefix $ZYNQ_QT_INSTALL \
    8. -device linux-arm-xilinx-zynq-g++ \
    9. -device-option CROSS_COMPILE=arm-xilinx-linux-gnueabi- \
    10. -release \
    11. -confirm-license \
    12. -opensource \
    13. -optimized-qmake \
    14. -no-qml-debug \
    15. -qt-zlib \
    16. -qt-libpng \
    17. -qt-libjpeg \
    18. -qt-freetype \
    19. -qt-harfbuzz \
    20. -qt-pcre \
    21. -no-xcb \
    22. -qt-xkbcommon \
    23. -no-opengl \
    24. -no-pch \
    25. -verbose \
    26. -no-kms \
    27. -no-eglfs \
    28. -no-icu \
    29. -no-iconv \
    30. -skip qtwebkit \
    31. -tslib \
    32. -no-gcc-sysroot \
    33. -nomake tools \
    34. -no-compile-examples \
    35. -I /opt/tslib/include \
    36. -L /opt/tslib/lib
    To copy to clipboard, switch view to plain text mode 

    Here is the first error I received when making Qt, on moc tool:
    Qt Code:
    1. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    2. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    3. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    4. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    5. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    6. /usr/bin/ld: .obj/moc.o: Relocations in generic ELF (EM: 40)
    7. .obj/moc.o: error adding symbols: File in wrong format
    8. collect2: error: ld returned 1 exit status
    9. gmake[3]: *** [../../../bin/moc] Error 1
    10. gmake[3]: Leaving directory `/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/tools/moc'
    11. gmake[2]: *** [sub-moc-make_first] Error 2
    12. gmake[2]: Leaving directory `/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src'
    13. gmake[1]: *** [sub-src-make_first] Error 2
    14. gmake[1]: Leaving directory `/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase'
    15. gmake: *** [module-qtbase-make_first] Error 2
    To copy to clipboard, switch view to plain text mode 

    The most recent command which generates the error is (using x86_64 g++):

    Qt Code:
    1. g++ -Wl,--gc-sections -Wl,-O1 -o ../../../bin/moc .obj/moc.o .obj/preprocessor.o .obj/generator.o .obj/parser.o .obj/token.o .obj/main.o -L/opt/tslib/lib -L/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/lib -lQt5Bootstrap -lpthread
    To copy to clipboard, switch view to plain text mode 
    which uses g++ instead of
    Qt Code:
    1. /home/adzh/opt/PetaLinux/petalinux-v2015.2.1-final/tools/linux-i386/arm-xilinx-linux-gnueabi/bin/arm-xilinx-linux-gnueabi-g++
    To copy to clipboard, switch view to plain text mode 

    When I got to directory of moc tools (qtbase/src/tools/moc), I find that the LINK in make file is g++ instead of arm-xilinx-linux-gnueabi-g++. If I change it to arm-xilinx-linux-gnueabi-g++ and to gmake from same directory it compiles without problems.

    When I go back to root of Qt source code and run gmake again, it compiles until it has the same error with rcc tools. I go to rcc directory and perform the same fix of changing LINK line from g++ to arm-xilinx-linux-gnueabi-g++. Finally, when I go back to root directory one more time and run gmake, it gives me final error which I am not sure how to fix. The final error is with compilation of corelibs.
    Commands executed and error:
    Qt Code:
    1. /home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/devices/linux-arm-xilinx-zynq-g++ -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/zlib -I/opt/tslib/include -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/include -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0 -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0/QtCore -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/global -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/pcre -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/harfbuzz/src -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/md5 -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/md4 -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/sha3 -I/home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/forkfd -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/include/c++/4.9.1 -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/include/c++/4.9.1/arm-xilinx-linux-gnueabi -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/include/c++/4.9.1/backward -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/lib/gcc/arm-xilinx-linux-gnueabi/4.9.1/include -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/lib/gcc/arm-xilinx-linux-gnueabi/4.9.1/include-fixed -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/include -I/home/adzh/opt/Xilinx/SDK/2015.2/gnu/arm/lin/arm-xilinx-linux-gnueabi/libc/usr/include animation/qabstractanimation.h -o .moc/moc_qabstractanimation.cpp
    2. /home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/bin/moc: 1: /home/adzh/Projects/qt-everywhere-opensource-src-5.6.0/qtbase/bin/moc: Syntax error: word unexpected (expecting ")")
    3. make: *** [.moc/moc_qabstractanimation.cpp] Error 2
    To copy to clipboard, switch view to plain text mode 

    I am guess it is possible that last command expect a x86_64 moc binary instead of ARM moc binary. If that true, how can I fix the first error with ".obj/moc.o: error adding symbols: File in wrong format".
    Does anyone know how I can fix this?

  2. #2
    Join Date
    Apr 2016
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt compile for Xilinx Zynq fails -- errors in building moc and rcc tools and core

    Hi,
    I realize it's been 3 weeks since your original post, but maybe this could be useful. The attached scripts worked for me. I haven't added the QWT build yet. I guess that's next.

    Jason
    Attached Files Attached Files

Similar Threads

  1. Building Qt 4.8.3 - cross-compile using MSVC 2010 x64 tools
    By oleg_stepanenko@bk.ru in forum Installation and Deployment
    Replies: 0
    Last Post: 4th December 2012, 10:08
  2. Replies: 1
    Last Post: 14th November 2012, 19:20
  3. Errors during building
    By karlkar in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 28th June 2011, 21:58
  4. Errors while building
    By T0bi4s in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 02:15
  5. Building of MySQL plugin fails
    By janca in forum Installation and Deployment
    Replies: 2
    Last Post: 21st January 2006, 09:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.