> if your question is about how to do cross compilation on a Debian system then
> you came to the right place!
Looks like I'm at least partially in the right place, thanks for the welcome!
> I happen to be the maintainer of sbuild in Debian and I never heard of the
> mk-sbuild tool. Where do you have this from and what does it do?
Oh, it seems like I'm a bit off-base here:
-
https://wiki.debian.org/mk-sbuildIt seems like `mk-sbuild` is actually some kind of wrapper script for Ubuntu,
rather than a Debian tool, however it only seems to be direct convenience
wrappers around `sbuild` and `schroot` as far as I can tell.
> Why do you want to use a sysroot? Just use multi-arch and install the foreign
> architecture packages directly on your system without a foreign architecture
> chroot somewhere.
> I'm also curious where you found the information to use a sysroot for cross
> compilation. This is outdated for several years now and I do not know anybody
> who does this these days. Is there any reason you need to use a sysroot over
> just using multiarch?
Oh interesting, this is all things I've pieced together from far arguably too
many sources (basically from googling "cross compiling aarch64"), I went ahead and
dug some of them up here just in case:
-
http://hypernephelist.com/2015/03/09/cross-compilation-made-easy-on-ubuntu-with-sbuild.html-
https://discourse.cmake.org/t/linux-cross-compile-x64-to-aarch64/1752-
https://discourse.cmake.org/t/cross-compile-for-aarch64-on-ubuntu/2161-
https://github.com/rsenn/cmake-toolchains/blob/master/aarch64-linux-gnu.toolchain.cmake-
https://github.com/sony/flutter-embedded-linux/blob/master/cmake/cross-toolchain-aarch64-template.cmakeI had some previous experience with using sysroots for Android which is
apparently still used extensively, so I didn't see anything all that wrong with
using that for cross-compiling for other systems (Aarch64 in my case).
Additionally, most of this worked just fine until I used `find_library` (which
is recommended for CMake to get the -lm library) hence the confusion when
everything stopped working.
My main reason for using sysroots is really just to have an easy place to collect thirdparty
packages from, which in my case are zlib, libpng, libOpenEXR and a few others,
but from what you mention here it seems like a lot of this information is
out-of-date or incorrect. I didn't really come across "mutliarch" at all while I was looking this up.
I did a bit more googling (using the multiarch keyword now). I guess this is a good
place to read-up on using multiarch packages to download my dependencies?
-
https://wiki.debian.org/Multiarch/HOWTOBest regards,
Gustaf