Cross compiling for arm or aarch64 on Debian or Ubuntu

preview_player
Показать описание
In this video I'll explain how to do cross compiling for arm or aarch64 on Debian or Ubuntu. To make the resulting binaries portable, I'll also cover static linking.

It’s not always possible to build directly ARM-based devices, especially when they are limited in resources. The majority of build and developer machines are still on x86 and by using a cross compiler, it is possible to build binaries or executables usable on another architecture. For example, to use your standard PC, most likely x86, to build something that is usable on another machine or device that’s on another architecture, for example 32 bit or 64 bit ARM.

Contents:
- Theoretical explanation for cross compilation
- Cross compile of a basic C program for ARM aarch64
- Cross compilation with configure and make (strace)
- Static linking and advantages/disadvantages
- Cross compiling for ARM using musl (tcpdump).

Рекомендации по теме
Комментарии
Автор

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:)

slok
Автор

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

crypticcrypto
Автор

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.

Kasas
Автор

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

digicyc
Автор

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!

nazgulsenpai
Автор

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.

kamleshgandhi
Автор

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.

davidbrooks
Автор

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.

noodlish
Автор

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 .

ozgurayik
Автор

very nice simple and easy to understand with an avarage knowledge

nonix
Автор

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

PhalzuBG
Автор

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

system
Автор

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

Santosamapaio
Автор

Perfectly awesome video. Really helpful.

SyncEdgeHandle
Автор

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

robotisim
Автор

It was a really good explanation! thanks a lot!

juliandavidarroyavezuluaga
Автор

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.

Sunil-yzig
Автор

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.

esjay
Автор

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?

MikeSutton-hopc
Автор

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.

javeshbhardwaj