I want to make a hello world app for Librem5 with cross-compilation from Librem14. I read the development documentation and based on it I understand that development is done on the phone itself.
Is there any guide on how to cross-compile GTK app on Librem14 (x86_64) to aarch6?
I get dependancies on binutils and similar for the glib libraries.
Hi!
I’m just install qemu-aarch64 and create Byzantium/Crimson chroot. It is not “cross-compilation” (when your x86 host compile sources for aarch64 target) but the way to build something for librem5
Do you have a lapdock / dock? That’s going to make doing development on the Librem 5 itself a lot more pleasant.
How big is the application? If it’s 10,000,000 lines of code, it sure will compile faster on the Librem 14.
Is it supposed to be a GUI adaptive application where you really need to test on both the Librem 5 and the Librem 14 (and if you have a lapdock / dock then on the Librem 5 both docked and undocked).
Do you have enough free disk space on the Librem 5? If you end up installing large toolchains then it may be easier to use disk space on the Librem 14 and treat the Librem 5 as strictly the target environment.
For Hello World, I would just do it on the Librem 5 - to prove that it can be done!
And the cheat answer … write in Java instead. Then the same binary should work anywhere. Embrace the “Write Once, Run Anywhere” principle. But then cynics have suggested it is really more like “Write Once, Debug Everywhere”.
I have Dell dock station that works perfectly with the Librem5. I get external monitor, keyboard and mouse working with it.
I want to learn how to write a simple app. I don’t have any app ready. I want to learn how to write adaptive GTK app that works both docked and undocked.
My Librem5 has SD card with 64GB capacity. I can get a bigger one if needed.
Haha I will take that Java suggestion but I really want to try rust instead
Tonight I will start with GNOME Builder on the phone itself using the docking station and then I will try to install Byzantium in chroot with Aarch64 QEMU on my laptop.
Thanks, everyone, for your suggestions! I used @galilley ’s comment about QEMU and @laurent ’s comment and repo about Docker to create my own Docker image emulated with QEMU to compile a Rust GTK4 program for aarch64 on my x86_64 desktop. I also added support for direct execution from the Docker container through the Wayland and DBus sockets on the host. In the end, I was able to write an app on my Librem14, compile it for aarch64, and execute it on my laptop. Then, when I copied the resulting binary to my Librem5, it ran without any issues.
Here is the hello app running on Librem14 through aarch64 docker with QEMU
@laurent I tried to create a merge request with an email but got the follwoing reply from GitLab:
Unfortunately, your email message to GitLab could not be processed.
You are not allowed to perform this action. If you believe this is in error, contact a staff member.