Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm
QtWS25 Last Chance

QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
14 Posts 7 Posters 6.7k Views
  • 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.
  • Q Offline
    Q Offline
    qt_help
    wrote on 14 Jun 2018, 20:46 last edited by
    #3

    Tried with -x64 still same

    /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/nbabu/raspi/sysroot -O2 -std=gnu++11 -w -fPIC -I. -I/home/nbabu/raspi/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o verifyspec.o verifyspec.cpp

    /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/nbabu/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/nbabu/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/nbabu/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/nbabu/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o
    /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
    /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
    /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
    collect2: error: ld returned 1 exit status
    Makefile:66: recipe for target 'verifyspec' failed
    make: *** [verifyspec] Error 1
    Note: Also available for Linux: linux-clang linux-icc

    Z 1 Reply Last reply 29 Sept 2018, 19:18
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 14 Jun 2018, 20:53 last edited by
      #4

      Then it is a broken toolchain or sysroot. Make sure you have all the dependencies installed on Raspbian and run sysroot + symlink fix on your toolchain. Then git pull in your toolchain dir to make sure it's up to date.

      (Z(:^

      1 Reply Last reply
      2
      • S Offline
        S Offline
        sefer
        wrote on 15 Sept 2018, 08:27 last edited by sefer
        #5

        Hi,

        may you have to execute rsync on ~/raspi folder
        raspberrypi.local is the ip of the pi3, example 192.168.1.10

        mkdir sysroot sysroot/usr sysroot/opt
        rsync -avz pi@raspberrypi.local:/lib sysroot
        rsync -avz pi@raspberrypi.local:/usr/include sysroot/usr
        rsync -avz pi@raspberrypi.local:/usr/lib sysroot/usr
        rsync -avz pi@raspberrypi.local:/opt/vc sysroot/opt

        1 Reply Last reply
        1
        • Q qt_help
          14 Jun 2018, 20:46

          Tried with -x64 still same

          /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/nbabu/raspi/sysroot -O2 -std=gnu++11 -w -fPIC -I. -I/home/nbabu/raspi/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o verifyspec.o verifyspec.cpp

          /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/nbabu/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/nbabu/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/nbabu/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/nbabu/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o
          /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
          /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
          /home/nbabu/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
          collect2: error: ld returned 1 exit status
          Makefile:66: recipe for target 'verifyspec' failed
          make: *** [verifyspec] Error 1
          Note: Also available for Linux: linux-clang linux-icc

          Z Offline
          Z Offline
          zhmh
          wrote on 29 Sept 2018, 19:18 last edited by
          #6

          @qt_help as @sefer said the sysroot folder should be create and rsysc in the ~/raspi address

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ab_en
            wrote on 18 Jun 2020, 22:16 last edited by
            #7

            Any known solutions to this? Why is rsync necessary for correct build?

            J 1 Reply Last reply 19 Jun 2020, 04:45
            0
            • A ab_en
              18 Jun 2020, 22:16

              Any known solutions to this? Why is rsync necessary for correct build?

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 19 Jun 2020, 04:45 last edited by
              #8

              @ab_en said in QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm:

              Why is rsync necessary for correct build?

              To synchronise the sysroot (which is basically copy of the RPi file system).
              Strictly speaking rsync is not necessary, you can simply copy the content of /usr from your RPi to your host machine. But rsync is convenient to synchronise the sysroot if you change something on RPi.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply 19 Jun 2020, 19:48
              0
              • J jsulm
                19 Jun 2020, 04:45

                @ab_en said in QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm:

                Why is rsync necessary for correct build?

                To synchronise the sysroot (which is basically copy of the RPi file system).
                Strictly speaking rsync is not necessary, you can simply copy the content of /usr from your RPi to your host machine. But rsync is convenient to synchronise the sysroot if you change something on RPi.

                A Offline
                A Offline
                ab_en
                wrote on 19 Jun 2020, 19:48 last edited by
                #9

                @jsulm Ok! I was able to copy the the usr/ folder from the RPi and I got through that issue, but now it is saying the file or file format is not recognized:

                > /home/abenezerargaw/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/abenezerargaw/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o      
                > /home/abenezerargaw/raspi/sysroot/usr/lib/crt1.o: file not recognized: File format not recognized
                > collect2: error: ld returned 1 exit status
                > Makefile:68: recipe for target 'verifyspec' failed
                > gmake: *** [verifyspec] Error 1
                Note: Also available for Linux: linux-clang linux-icc
                
                ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
                
                

                I assume I would need to rebuild the file but I am unsure how to do this. Any suggestions or guidance? (the more detailed the better! -- Thank you in advance)

                A S 2 Replies Last reply 19 Jun 2020, 20:05
                0
                • A ab_en
                  19 Jun 2020, 19:48

                  @jsulm Ok! I was able to copy the the usr/ folder from the RPi and I got through that issue, but now it is saying the file or file format is not recognized:

                  > /home/abenezerargaw/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/abenezerargaw/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o      
                  > /home/abenezerargaw/raspi/sysroot/usr/lib/crt1.o: file not recognized: File format not recognized
                  > collect2: error: ld returned 1 exit status
                  > Makefile:68: recipe for target 'verifyspec' failed
                  > gmake: *** [verifyspec] Error 1
                  Note: Also available for Linux: linux-clang linux-icc
                  
                  ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
                  
                  

                  I assume I would need to rebuild the file but I am unsure how to do this. Any suggestions or guidance? (the more detailed the better! -- Thank you in advance)

                  A Offline
                  A Offline
                  ab_en
                  wrote on 19 Jun 2020, 20:05 last edited by
                  #10

                  @ab_en @sierdzio

                  1 Reply Last reply
                  0
                  • A ab_en
                    19 Jun 2020, 19:48

                    @jsulm Ok! I was able to copy the the usr/ folder from the RPi and I got through that issue, but now it is saying the file or file format is not recognized:

                    > /home/abenezerargaw/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/abenezerargaw/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/abenezerargaw/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o      
                    > /home/abenezerargaw/raspi/sysroot/usr/lib/crt1.o: file not recognized: File format not recognized
                    > collect2: error: ld returned 1 exit status
                    > Makefile:68: recipe for target 'verifyspec' failed
                    > gmake: *** [verifyspec] Error 1
                    Note: Also available for Linux: linux-clang linux-icc
                    
                    ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
                    
                    

                    I assume I would need to rebuild the file but I am unsure how to do this. Any suggestions or guidance? (the more detailed the better! -- Thank you in advance)

                    S Offline
                    S Offline
                    sierdzio
                    Moderators
                    wrote on 19 Jun 2020, 20:29 last edited by
                    #11

                    @ab_en said in QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm:

                    raspbian-x64

                    Do you have 64b Raspbian installed on that RPi? If not, then you should not compile your Qt using 64b compiler.

                    (Z(:^

                    A 1 Reply Last reply 22 Jun 2020, 14:31
                    1
                    • S sierdzio
                      19 Jun 2020, 20:29

                      @ab_en said in QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm:

                      raspbian-x64

                      Do you have 64b Raspbian installed on that RPi? If not, then you should not compile your Qt using 64b compiler.

                      A Offline
                      A Offline
                      ab_en
                      wrote on 22 Jun 2020, 14:31 last edited by
                      #12

                      @sierdzio Yes, I am running Poky Yocto Project Distribution image for RPi4 64b

                      A Pablo J. RoginaP 2 Replies Last reply 22 Jun 2020, 15:04
                      0
                      • A ab_en
                        22 Jun 2020, 14:31

                        @sierdzio Yes, I am running Poky Yocto Project Distribution image for RPi4 64b

                        A Offline
                        A Offline
                        ab_en
                        wrote on 22 Jun 2020, 15:04 last edited by
                        #13

                        @ab_en same issue persists if non 64b selected fyi

                        1 Reply Last reply
                        0
                        • A ab_en
                          22 Jun 2020, 14:31

                          @sierdzio Yes, I am running Poky Yocto Project Distribution image for RPi4 64b

                          Pablo J. RoginaP Offline
                          Pablo J. RoginaP Offline
                          Pablo J. Rogina
                          wrote on 22 Jun 2020, 15:12 last edited by
                          #14

                          @ab_en said in QT 5.10 Cross Compilation raspberry Pi Issue cannot find crt1.o & cannot find -lm:

                          Poky Yocto Project Distribution image for RPi4 64b

                          So are you sure the cross-compiler you use (i.e. ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-) which seems to come from Rasbperry Foundation repo is Ok/compatible with such OS/distribution?

                          Upvote the answer(s) that helped you solve the issue
                          Use "Topic Tools" button to mark your post as Solved
                          Add screenshots via postimage.org
                          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                          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