Cross compile setup for TI processor



  • Hello all,

    So I am new to Qt and my work is having me evaluate it for an upcoming project. The thing is, is that the processor manufacturer is unable (or perhaps unwilling) to help us get the framework up and running on their processor.

    The spec sheet and information can be found here: TI Keystone II

    I am running on Ubuntu 16.04 with Qt 5.10 and creator 4.5.0 (The latest from the online installer).

    So my issue is getting it to cross compile. I seem to be unable to make a kit that will build Qt for a Linux-arm (gnueabihf) architecture which seems to stem from 2 separate issues.

    First I am missing the proper Qt Version. I have been reading up on the ./configure command but without a proper mkspec I seem to be stuck. All the online documentation seems to point to .../5.10.0/Src/qtbase/mkspecs to find the correct qmake.conf file. The closest I find in that file is the linux-arm-gnueabi-g++ which I believe can be modified to support hard float as well as other processor features but I really don't even have a general idea of how that file should look for my processor. I am wondering if anyone here has already done the footwork necessary for this.

    Second issue seems to be an absence of any kind of Sysroot. I have scoured the TI site and been in contact with the company and I don't seem to be getting anywhere. The TI toolchain seems to be designed with only Code Composer Studio in mind. So trying to find a device image in order to create a usable cross compile kit seems to be more trouble than its worth. I cant be the only person that has run into this problem though.

    Any help in solving any portion of this will be greatly appreciated.


  • Moderators

    @Rlkcpo You can use the file system of your device as sysroot. You could mount it using NFS or simply put SDCard (if it uses SDCard) into your PC or make an image from the device file system.



  • Awesome! Thanks for taking the time to respond!

    Is there anyway you can be more specific on making an image from the device file system? The device has a Linux kernel installed on it and not much more. Unfortunately the SD card is not an option.


  • Moderators



  • OK ill try and be more specific.

    Is it necessary to create an entire hard disk image in order to get what I need? Is the entirety of the device memory (including the entire Linux kernel) required to be cloned, and then transferred to my local machine and use that file as the link to the sysroot in the Qt Kit? Sorry if I am being obtuse. Ive never done this before and Qt documentation on what is required to generate the proper makefiles seems a bit limited.

    Again thanks for responding!



  • @Rlkcpo on one hand, you may want to take a look at the support for Qt framework TI is/was? providing for its Sitara product, so at some point TI is aware of Qt :-)
    On the other hand, this post mentions that Keystone devices "... do not have any kind of graphics hardware, display hardware, or multimedia acceleration ...".

    I don't know anything about the device, but if that assertion is (partially)true, the question is why are you interested in using Qt framework? Although Qt is perfect for developing multi-platform non-GUI applications (one source code, several platforms to run it) are you sure Qt is a good fit? Are you porting some application already built using Qt to this device?

    Least but not last, in any event that you know your device is supported somehow by Yocto, you may want to take a look at these posts here and here about integrating Qt/Qt Creator with devices via Yocto.


  • Moderators

    @Rlkcpo What you need is /usr (it contains /usr/include and /usr/lib).
    It is not a file that you need to use to cross compile it is a directory containing all needed stuff like

    ~/sysroot/usr
    

    You then can add the path to the sysroot in QtCreator in your Kit configuration.



  • @Pablo-J.-Rogina said in Cross compile setup for TI processor:

    @Rlkcpo on one hand, you may want to take a look at the support for Qt framework TI is/was? providing for its Sitara product, so at some point TI is aware of Qt :-)
    On the other hand, this post mentions that Keystone devices "... do not have any kind of graphics hardware, display hardware, or multimedia acceleration ...".

    I don't know anything about the device, but if that assertion is (partially)true, the question is why are you interested in using Qt framework? Although Qt is perfect for developing multi-platform non-GUI applications (one source code, several platforms to run it) are you sure Qt is a good fit? Are you porting some application already built using Qt to this device?

    Least but not last, in any event that you know your device is supported somehow by Yocto, you may want to take a look at these posts here and here about integrating Qt/Qt Creator with devices via Yocto.

    Hey Pablo,

    Thanks for the reply. I have looked into the documentation that TI has for Sitara. As they supply all the required files (specifically a qmake.conf file and a /sysroot directory) that are specific to that processor, it doesn't really help me much.

    I have been speaking directly with the reps at TI and they seem as confused as you as to why we would want to put Qt on the keystone ii. Let me just say that Qt is much more powerful then a simple framework to make pretty GUIs. Especially in embedded systems. The overhead is negligible and the speed with which our new developers grasp the concepts is absolutely amazing.

    I might be wrong here but I don't believe Yocto is going to help me either. Im still going to need to create a qmake binary and try to piece together a sysroot directory for my specific processor.



  • @Rlkcpo I agree with you, and I'm a great advocate of, using Qt framework for developing non-GUI applications as well. It provides a good set of different modules (i.e. networking, command line parsing, XML processing, etc. etc.) that speed up developing and help maintaining non-GUI applications with C++ for a good set of different platforms.
    Good luck with the remaining work ahead!



  • Ok so I "think" I am making some progress. I think I found what might be considered my devices sysroot thanks to @jsulm in my devices /usr directory. I just copied that entire directory to my local machine and am using it as my sysroot (correct me please if this is wrong).

    I am now ready to create my Qt version and qmake. I ran the configure tool with these options:

    ./configure -xplatform linux-TIarmv7-g++ -opensource -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscxml -skip qtsensors -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebview -skip qtwinextras -skip qtxmlpatterns -verbose -shared -confirm-license -no-force-asserts -no-feature-accessibility -no-feature-gui -sysroot /scratchnobackup/usr
    

    It creates the binary and this is my output:

    This is the Qt Open Source Edition.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: linux-TIarmv7-g++ (arm, CPU features: neon)
    Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 c++1z concurrent dbus no-pkg-config no-gui reduce_exports stl no-widgets
    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C++ standard ..................... C++1z
      Using ccache ........................... no
      Using gold linker ...................... yes
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. yes
      Build parts ............................ libs examples
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. no
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. no
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... no
      QML debugging .......................... yes
      udev ................................... no
      Using system zlib ...................... no
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... no
      iconv .................................. yes
      ICU .................................... no
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... no
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      OpenSSL ................................ no
        Qt directly linked to OpenSSL ........ no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... no
      FreeType ............................... yes
        Using system FreeType ................ no
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. no
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ no
      EGL .................................... no
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ no
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
        OpenGL ES 3.2 ........................ no
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... no
      INTEGRITY HID .......................... no
      mtdev .................................. no
      tslib .................................. no
      xkbcommon-evdev ........................ no
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... no
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    Qt SerialBus:
      Socket CAN ............................. yes
      Socket CAN FD .......................... yes
    
    Note: Also available for Linux: linux-clang linux-icc
    
    WARNING: Accessibility disabled. This configuration of Qt is unsupported.
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/scratchnobackup/usr/usr/local/Qt-5.10.0'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    
    

    I then run $make

    arm-linux-gnueabihf-g++ --sysroot=/scratchnobackup/usr --sysroot=/scratchnobackup/usr -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-rpath,/usr/local/Qt-5.10.0/lib -o qt    -lpthread 
    /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/lib/../lib/crt1.o(.text+0x28): error: undefined reference to 'main'
    collect2: error: ld returned 1 exit status
    Makefile:106: recipe for target 'qt' failed
    make: *** [qt] Error 1
    
    

    In the past I have seen this before but it was usually because of the binary wasn't to be used as an executable and forgot the -c linker flag. Thanks in advance for any assistance.


  • Moderators

    @Rlkcpo said in Cross compile setup for TI processor:

    -sysroot /scratchnobackup/usr

    remove usr from the sysroot path:

    -sysroot /scratchnobackup
    


  • Thanks for the help @jsulm, I really appreciate it.

    Unfortunately that didn't fix it.

    arm-linux-gnueabihf-g++ --sysroot=/scratchnobackup -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-rpath,/usr/local/Qt-5.10.0/lib -o qt    -lpthread 
    /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/lib/../lib/crt1.o(.text+0x28): error: undefined reference to 'main'
    collect2: error: ld returned 1 exit status
    Makefile:106: recipe for target 'qt' failed
    make: *** [qt] Error 1
    
    

  • Moderators

    @Rlkcpo Maybe you should start from a clean source tree (it is better to do out of source builds).



  • Im not sure what you mean. Are you suggesting I reinstall Qt?


  • Moderators

    @Rlkcpo Not reinstalling Qt. It looks like you did not use out of source builds, so all build artefacts are inside Qt source code tree and can effect later builds. Just unpack Qt source code and try from this clean state.



  • I think im following you. Currently my source folder is /scratchnobackup/Qt5.10/5.10.0/Src

    You want me to move the Src directory outside of the Qt install directory and run configure again correct?


  • Moderators

    @Rlkcpo No. What I suggest is: delete Src directory and extract Qt sources again.



  • I used the online installer. It all installs to the same directory. Ii saw some posts earlier about building Qt from source off of git. Let me see if I can find that again.



  • I ran the installer again to try and see if I could just get the sources and if you select Qt and tunnel into that there is a separate sources folder you can select.

    Im sorry if I ask too many questions about this. I have used Qt in an embedded environment for a while now but I have never had to install it. So all of this is new to me.



  • Ok I installed the source again in a different directory (/scratchnobackup/QtSource/5.10.0/Src)and am still getting the same error.
    (ran without defining a sysroot, as well as with it defined as /scratchnobackup/usr and just /scratchnobackup)

    arm-linux-gnueabihf-g++ --sysroot=/scratchnobackup --sysroot=/scratchnobackup -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-rpath,/usr/local/Qt-5.10.0/lib -o qt    -lpthread 
    /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/lib/../lib/crt1.o(.text+0x28): error: undefined reference to 'main'
    collect2: error: ld returned 1 exit status
    Makefile:106: recipe for target 'qt' failed
    make: *** [qt] Error 1
    
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.