Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Cross-compile 5.7 Ubuntu 16.04 Error
Forum Updated to NodeBB v4.3 + New Features

Cross-compile 5.7 Ubuntu 16.04 Error

Scheduled Pinned Locked Moved Unsolved QtonPi
10 Posts 7 Posters 10.8k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rchamberlin
    wrote on last edited by rchamberlin
    #1

    I'm attempting to set up cross-compile using Ubuntu 16.04 and Qt 5.7 following this guide:

    https://wiki.qt.io/RaspberryPi2EGLFS

    I get all the way to the configure step:

    ./configure -release -opengl es2 -device linux-rasp-pi2-g++ \
    -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \
    -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs \
    -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
    

    but I'm getting this error:

    Makefile:195: recipe for target 'atomicfptr.o' failed
    make: *** [atomicfptr.o] Error 1
    std::atomic for function pointers disabled.
    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
      /home/keepstockdev/raspi/qtbase/config.tests/common/atomicfptr
    

    I am unsure what libraries I might be missing, or how to apply the patch that it's talking about in the error message.

    Can anybody help point me in the right direction?

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You're not missing any library. What is suggested is to patch the STD library used by your toolchain. You might want to check with the folks behind it directly for more information about what version of the tools and libraries they are using.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • RudlR Offline
        RudlR Offline
        Rudl
        wrote on last edited by
        #3

        I got the same problem. Did you still find any solution?
        I use Ubuntu 14.04 and QT 5.7.

        1 Reply Last reply
        0
        • Sh0rtCut457S Offline
          Sh0rtCut457S Offline
          Sh0rtCut457
          wrote on last edited by
          #4

          Hi,

          You just need to (re)mount the image of Raspbian with this :

          sudo mount -o loop,offset=62914560 2015-05-05-raspbian-wheezy.img /mnt/rasp-pi-rootfs
          

          Of course if you use Jessie instead you will need to change the offset,

          Hope this helps,
          Arthur

          1 Reply Last reply
          0
          • feniks_fireF Offline
            feniks_fireF Offline
            feniks_fire
            wrote on last edited by
            #5

            Hey, today I was able to do this for Qt 5.7 for Raspbian Jessie. I have Ubuntu 16.04 if you ask ;).
            Just do everything from site https://wiki.qt.io/Raspberry_Pi_Beginners_Guide until "Compiling qtbase".
            In example I download from link in https://wiki.qt.io/Raspberry_Pi_Beginners_Guide compiler - https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz because from https://wiki.qt.io/RaspberryPi2EGLFS doesn't work properly for me.
            The only thing that will change is "Compiling qtbase".
            You need doing this step from https://wiki.qt.io/RaspberryPi2EGLFS.

            6. Adjust symlinks to be relative. Instead of the old fixQualifiedLibraryPaths get a script that works:
            
            wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
            chmod +x sysroot-relativelinks.py
            ./sysroot-relativelinks.py sysroot
            

            and if this is work you can try, this configure

            ./configure \
            -release \
            -opengl es2 \
            -optimized-qmake \
            -no-pch \
            -make libs \
            -make tools \
            -reduce-exports \
            -device linux-rasp-pi-g++ \
            -device-option CROSS_COMPILE=~/Raspberry/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- \
            -sysroot /mnt/rasp-pi-rootfs \
            -opensource \
            -confirm-license \
            -prefix /usr/local/Qt-5.7.0-raspberry \
            -extprefix /usr/local/Qt-5.7.0-raspberry \
            -hostprefix /usr/local/Qt-5.7.0-raspberry  \
            

            and this is all, it's work for me ;)

            1 Reply Last reply
            1
            • A Offline
              A Offline
              AlTro
              wrote on last edited by AlTro
              #6

              Hi, I've got same error when trying to compile Qt 5.7 on Ubuntu 16.04 with gcc 4.9.3 linaro toolchain.
              I followed the suggestion of fenix_fire running this command:

              ./sysroot-relativelinks.py /mnt/raspi-rootfs
              

              and then:

              ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspberry/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/raspi-rootfs -opensource -confirm-license -make libs -prefix /usr/local/qt5.7-raspi -extprefix ~/raspberry/qt5.7-raspi -hostprefix ~/raspberry/qt5.7 -v
              

              configure fails and give the error of the topic because of this other error:

              /mnt/raspi-rootfs/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
              

              If I search cdefs.h in /mnt/raspi-rootfs/usr/ it is found in /mnt/raspi-rootfs/usr/include/arm-linux-gnueabihf/sys/cdefs.h

              How can I set compiler to search includes in the right directory?
              Thanks

              1 Reply Last reply
              0
              • feniks_fireF Offline
                feniks_fireF Offline
                feniks_fire
                wrote on last edited by feniks_fire
                #7

                @AlTro
                Well if nobody can answer, may try another way.
                Like I said, the compiler from https://github.com/raspberrypi/tools may not work correctly, so try download this compiler:

                https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz
                

                -Unzip this in your ~/raspberry folder
                -Mount image
                -If you must, use again:

                sudo ./sysroot-relativelinks.py /mnt/rasp-pi-rootfs
                

                go to your qtbase and try this configure:

                ./configure \
                -release \
                -opengl es2 \
                -optimized-qmake \
                -no-pch \
                -make libs \
                -make tools \
                -reduce-exports \
                -device linux-rasp-pi-g++ \
                -device-option CROSS_COMPILE=~/raspberry/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- \
                -sysroot /mnt/rasp-pi-rootfs \
                -opensource \
                -confirm-license \
                -prefix /usr/local/Qt-5.7.0-raspberry \
                -extprefix /usr/local/Qt-5.7.0-raspberry \
                -hostprefix /usr/local/Qt-5.7.0-raspberry  \
                
                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  AlTro
                  wrote on last edited by
                  #8

                  This configuration works, but the problem is that gcc 4.7 doesn't have full c++11 support and my code was compiled only with gcc 4.9.
                  Luckily I changed only one line of code and all compiled well; but this is a real problem with legacy code because it's not possible, and good, to downgrade it.

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    Oliver Hertel
                    wrote on last edited by
                    #9

                    Hey ALTro,

                    I'm facing the same problem right now.Could you post your solution, please?

                    Thanks!

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      AlTro
                      wrote on last edited by AlTro
                      #10

                      @Oliver-Hertel
                      As I said there is no solution for now with gcc 4.9.3 cross-compiler from https://github.com/raspberrypi/tools.
                      The configuration that feniks_fire suggest works, so follow https://wiki.qt.io/RaspberryPi2EGLFS guide but use the gcc-4.7-linaro cross-compiler.
                      The big problem is that if you have already written code with some c++11 features that gcc4.7 doesn't support, you have to evaluate if downgrading your code is better than compile directly on raspberry.
                      For example look at this problem that I get because of this https://forum.qt.io/topic/71407/cross-compiling-errors-linking-my-own-library

                      Hope this answer can help you.

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved