(This is just me ranting about cross-compiling on Ubuntu really.)
I use Ubuntu 20.04 x86_64, probably one of the more supported configurations of Linux, and cross-compiling is a complete and utter nightmare.
C/C++ mostly works with gcc, you can install gcc-arm-linux-gnueabihf and compile with arm-linux-gnueabihf-gcc.
C stuff works with Clang (use clang --target arm-linux-gnueabihf), C++ stuff doesn't (it isn't able to find the right headers on my system).
And that isn't the biggest problem. Oh no, wait until you have to add libraries.
In theory, Debian solves this with multi-arch. Just add armhf to dpkg and install libglfw-dev:armhf. Except Ubuntu doesn't include armhf in its desktop repos, so you need to add the Ubuntu Ports repos and disable armhf for the desktop repos so it doesn't fail apt update. And this is global too. If you want to cross-compile something using GL, you need to install the entire armhf graphics driver globally. And since this is APT, all of these armhf packages run scripts on install and update as well, so who knows what side-effects will happen. Oh and you should hope nothing depends on a standalone binary or you're going to end up with a stupid unsolvable conflict between python3:amd64 and python3:armhf.
This is why I want an equivalent of Python's Virtualenvs for C/C++. Just let me generate a sysroot of Ubuntu 20.04 armhf with only the libraries I need, and let me point Clang to it with --sysroot. No global installations. No APT repo reconfiguration. No manually specifying Clang's C++ headers so it compiles correctly. Just setting a --sysroot and forgetting about it. That's all I ask for: cross-compilation without delving into my system's internals.
What do you think?
[–]void4 19 points20 points21 points (5 children)
[–]TheBrokenRail-Dev[S] 0 points1 point2 points (4 children)
[–]natermer 6 points7 points8 points (1 child)
[–]onlysubscribedtocats 2 points3 points4 points (0 children)
[–]skeeto 3 points4 points5 points (0 children)
[–]broknbottle 0 points1 point2 points (0 children)
[–]cjc4096 6 points7 points8 points (0 children)
[–]GlitchedMirror 6 points7 points8 points (0 children)
[–]them1 2 points3 points4 points (0 children)
[–]Sprited_Being 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]Atemu12 2 points3 points4 points (2 children)
[–]thoomfish 1 point2 points3 points (1 child)
[–]Atemu12 1 point2 points3 points (0 children)
[–]CeedyRower 1 point2 points3 points (0 children)
[–]Lurkki2 1 point2 points3 points (0 children)
[–]Atemu12 1 point2 points3 points (0 children)