Cross compiling for arm or aarch64 on Debian or Ubuntu

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น • 66

  • @slok1394
    @slok1394 2 หลายเดือนก่อน +3

    Just started my career as an embedded dev in an automobile company. My head used to spin when I heard cross-compilation for armhf. This is exactly what I needed. Keep up the good work! You just got a new subscriber:)

  • @crypticcrypto7689
    @crypticcrypto7689 2 ปีที่แล้ว +14

    One of the most concise, to the point, knowledge-packed video on YT. Thanks heaps man!

    • @jurgenvanimpe6465
      @jurgenvanimpe6465 ปีที่แล้ว

      Fully agree! Exactly what I needed to understand this :)

  • @Kasas90
    @Kasas90 3 ปีที่แล้ว +5

    YOU NAILED IT. Spent literally days to move from theory to practice, and you have just smashed it, just like that, making me feel like a noob. Liked and subscribed bro.

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว

      Thanks a lot for the nice feedback, makes it worth spending time on this :)

  • @nazgulsenpai
    @nazgulsenpai 3 ปีที่แล้ว +6

    This is exactly what I needed. Building directly on the PinePhone is a pain for larger projects. I knew there had to be a better way!

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว +1

      Good to hear this helped you!

  • @kamleshgandhi6042
    @kamleshgandhi6042 9 หลายเดือนก่อน +1

    I had been struggling to cross-compile my application for NXP/Freescale i.mx6ul processor. Your article and video provided all the clarifications needed to actually build and copy executable on target machine and simply run it. Many thanks once again.

  • @davidbrooks5269
    @davidbrooks5269 2 ปีที่แล้ว +3

    Great video - direct, and to the point. I stopped it multiple times and replicated the steps on my systems to insure I understood. Everything functioned exactly as shown. Thanks again.

  • @digicyc
    @digicyc 2 ปีที่แล้ว +3

    For even my hello-world I had to pass in -static to get it to run. Great video!

    • @jensdbe
      @jensdbe  2 ปีที่แล้ว

      Thanks!

  • @nonix3470
    @nonix3470 ปีที่แล้ว +2

    very nice simple and easy to understand with an avarage knowledge

  • @ozgurayik7181
    @ozgurayik7181 6 หลายเดือนก่อน

    Well explained. I wish to see a few more videos on same topic. For example : cross compiling by connecting host machine's root directory by using sshfs and maybe even more practical example with cmake projects. Thanks for informative video .

  • @system7669
    @system7669 3 ปีที่แล้ว +2

    This video really cleared all of my doubts. Nice work 👍

  • @Santosamapaio
    @Santosamapaio 2 ปีที่แล้ว +2

    Job well done!! This is the best video about the topic! Thanks for sharing

  • @zameerahmed7369
    @zameerahmed7369 ปีที่แล้ว +2

    Ur explanation was awesome ..............

  • @noodlish
    @noodlish 3 ปีที่แล้ว +5

    Thanks for the excellent introduction. My case is needing aarch64 native extensions for Ruby but built on x86_64, since that's all we have for CI build hosts.

  • @PhalzuBG
    @PhalzuBG 8 หลายเดือนก่อน

    Thanks, this is a really good explanation of how cross-compiling works and what you should notice by doing so!~

    • @jensdbe
      @jensdbe  8 หลายเดือนก่อน

      Thanks, glad it was helpful!

  • @SyncEdgeHandle
    @SyncEdgeHandle 2 หลายเดือนก่อน +1

    Perfectly awesome video. Really helpful.

  • @robotisim
    @robotisim 2 ปีที่แล้ว +2

    You just solved a question i had for years .Thank YOU !

    • @jensdbe
      @jensdbe  2 ปีที่แล้ว

      Great to hear!

  • @juliandavidarroyavezuluaga1851
    @juliandavidarroyavezuluaga1851 3 ปีที่แล้ว +2

    It was a really good explanation! thanks a lot!

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว

      Thanks a lot for the nice feedback, good to hear you liked the video :)

  • @horaciomlhh
    @horaciomlhh 3 ปีที่แล้ว +2

    Very straightforward! thanks

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว

      Thanks for the positive feedback :)

  • @Sunil-yz7ig
    @Sunil-yz7ig 2 ปีที่แล้ว +2

    Great explanation.
    I want to do dynamic linking for my application and my libraries at host machine.
    Can someone point me on how to do this? How to find all dependency of my application, group all of them together at build machine. Later at run time at host, provide proper runtime environment variable to correctly run the application.
    Looking forward to responses.

  • @esjay3562
    @esjay3562 2 ปีที่แล้ว +2

    Generally, works fine except for big endian. When using option '-mbig-endian' it's only possible to compile object files. When building shared libraries or ELF files, error "libstdc++.so (wrong file format)" is issued. It seems the linker tries to use the little-endian version of the .so file.

  • @abdulbary3668
    @abdulbary3668 ปีที่แล้ว +2

    Thank you so much. You saved me

  • @MikeSutton-ho8pc
    @MikeSutton-ho8pc 5 หลายเดือนก่อน

    Enjoyed your training video. Have you ever tried to run a source-code security scan, like Fortify SCA for example, on a Linux Cross-Compiler-based software project?

  • @ThijsBolscher
    @ThijsBolscher ปีที่แล้ว +1

    What if I now would like to crosscompile a random other package like tensorflow?

    • @jensdbe
      @jensdbe  ปีที่แล้ว

      Similar approach for that. Pre-compile any prerequisites by doing ./configure and make. Then do the same for the actual package/binary that you want to compile. As I did for tcpdump in the video.
      Usually a bit of reading is required for the specifics/flags for each tool.

  • @javeshbhardwaj
    @javeshbhardwaj 3 ปีที่แล้ว +1

    Thank you for the nice video.But i am unable to compile c++ code, the arm c++ compiler throws the error "fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory". Any idea how can i get through?Thanks again.

  • @ourchannel9173
    @ourchannel9173 3 ปีที่แล้ว +1

    Need help with sp805 watchdog timer , pls can you share steps to program its drivers?

  • @manikantakumar2896
    @manikantakumar2896 3 ปีที่แล้ว +1

    i used this method ,while cross compilation it displays fatal error linux/init.h not found ,plz tell how to fix it

  • @rrkw7974
    @rrkw7974 4 หลายเดือนก่อน

    can you please make videos for android cross compilation and load the lkm from your host machine to target

  • @carlosmartins00098
    @carlosmartins00098 ปีที่แล้ว +1

    Muito obrigado por ensinar como complilar para arm, eu estou tentando instalar o yay(aur) no termux e não sei se o yay funciona fora do archlinux, instalei o pacman no termux e configurei tudo certinho mas o yay precisa da linguagem go 1.19 e o termux instala o go 1.12 e não tem o binário pronto em arm, então estou tentando compilar o go 1.19 para instalar o yay no termux.

  • @象棋大师-j4g
    @象棋大师-j4g 2 ปีที่แล้ว +2

    Very clear! Is it possiable to do the dynamic linking?

    • @jensdbe
      @jensdbe  2 ปีที่แล้ว

      Sure, that's the default, so if you don't pass the -static compiler flag, it should use dynamic linking

    • @象棋大师-j4g
      @象棋大师-j4g 2 ปีที่แล้ว

      @@jensdbe Thanks for your reply. Is it possiable to install the required arm64 libraries on a amd64 Ubuntu Computer.So I can cross-compile my own library to arm64.

  • @AshLucieas-vs6xl
    @AshLucieas-vs6xl 6 หลายเดือนก่อน +1

    Love this ❤

  • @mikolajwojnicki2169
    @mikolajwojnicki2169 3 ปีที่แล้ว +1

    I am not familiar with compiled languages. Could someone explain why in many cases (not shown in the video) programs don't work when compiled for a different architecture?
    In other words, why can't Apple just re-compile all it's programs so that they work on the M1 chip?

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว

      This can get quite complex but, at least as far as I understand it, simply said this is because a lot of tools/programs contain code or instructions tailored to one architecture. This is mainly done to gain performance. By using architecture specific and optimized ways of addressing the hardware and resources you can gain speed. Most CPUs, even when in theory they are on the same architecture have this kind of optimizations. Before you can recompile such code for another architecture, you would need to replace that CPU/arch-specific code with an alternative that works on the new arch. And even if you can, there might be an impact in performance or you might hit other limitations.

    • @mikolajwojnicki2169
      @mikolajwojnicki2169 3 ปีที่แล้ว +1

      @@jensdbe Thanks for the reply!

    • @AbdennacerAyeb
      @AbdennacerAyeb 3 ปีที่แล้ว

      When you write a program you try to do your best to optimize it. So Apple old software are written in a such way that are optimized on that old arch. That's why it need to rewrite the program to optimize it with their new M1 chip instead of old PowerPC arch to intel x64 Adoption.

  • @darpanshrivastava3539
    @darpanshrivastava3539 2 ปีที่แล้ว

    Is there a way to cross-compile python script on, let's say Ubuntu, to run on raspberry Pi armv7l? I have been searching a way to do this but haven't been able to get a concrete solution.

    • @jensdbe
      @jensdbe  2 ปีที่แล้ว

      Python scrips are generally compiled at runtime so they are platform independent. You just need to have the same libraries installed and they should work

  • @SHINOBHS
    @SHINOBHS หลายเดือนก่อน

    What if the project requires a ton of armhf or else libraries as dependencies?

    • @jensdbe
      @jensdbe  หลายเดือนก่อน +1

      Probably the best option is to script the whole process then instead of going through each manually.

    • @SHINOBHS
      @SHINOBHS หลายเดือนก่อน

      @jensdbe isn't creating a docker image with all requirements (like libsdl2-dev etc, the common ones) preinstalled more convenient? That said, i have no experience in doing that, just used other people's docker image to create stuff for my armhf handheld. Some times it works, some other it just needs more. Not existing in xenial repositories etc (that's a xenial armhf docker image)

  •  2 ปีที่แล้ว

    strace last version doesn't give executable or any file even the compilation doesn't give any error.

    •  2 ปีที่แล้ว +1

      Fixed with --prefix=$HOME

  • @wojtekkryptowski7509
    @wojtekkryptowski7509 3 ปีที่แล้ว

    Is this can by apply on RasPi 4B on Ubuntu 20.4? I can't install programs because Rasp is aarch64 and programs on Ubuntu are for amd64. Is my assumption is correct?

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว +1

      The easiest if off course to use tools and programs from the Ubuntu aarch64 repositories by using your regular package manager (apt). But if you need to compile something or want it static linked, then this is what you're looking for.

    • @wojtekkryptowski7509
      @wojtekkryptowski7509 3 ปีที่แล้ว

      @@jensdbe Thanks for info! Channel subscribe.

  • @GotUpLateWithMoon
    @GotUpLateWithMoon 2 ปีที่แล้ว +1

    thank you!

  • @vacagonzalo
    @vacagonzalo 2 ปีที่แล้ว +1

    thanks man!

  • @diegonayalazo
    @diegonayalazo 3 ปีที่แล้ว +1

    Thanks

  • @yasminebenghozzi6538
    @yasminebenghozzi6538 3 ปีที่แล้ว

    Can you please make a tutorial how to cross compile a python script?

  • @KangJangkrik
    @KangJangkrik 3 ปีที่แล้ว

    I wish I could donate a better microphone to you

    • @jensdbe
      @jensdbe  3 ปีที่แล้ว +1

      In the meanwhile, I got myself a better microphone, check out my latest videos and hopefully you should see an improvement. Nevertheless, donations are always welcome :)

  • @spudhead169
    @spudhead169 ปีที่แล้ว

    No, need to know how to compile a firmware image not an executable.