This topic is drives me for some time. Cross-compiling is actually a misnomer. Or and ambiguous term. Whatever. Basically, cross-compiling means at least two different things in different peoples minds.
The first group think of cross-compiling as a process, after which an executable is created from the source code for different operating systems, sometimes referred to as a cross-platform compilation. For instance for Windows, MacOS, Linux and possibly others. The resulting executable is able to run on one specific CPU architecture, most of the time, the same one the compilation was performed on. This is for example the case of pkg from Vercel (formerly Zeit), used from making an executable out of NodeJs source code.
The second group think of cross-compilation as making an executable that
can be run on different CPU architectures. Most of the times, compiling
on the x86_64 architecture, but meaning to run the resulting executable on
the ARM architecture (either 32 or 64 bit). The example of this is the case
of compilers that fall to the same category as aarch64-linux-gnu-gcc
for
C family languages or for the projects like
cross for Rust. There are of
course others available, I know golang can do that elegantly as well.
Why is this important?
I am writing about this because, I had dived into the topic quite extensively some time ago. With my latest discovery of tauri I tried to understand it can do cross-compilation for a different architecture in addition to cross-platform compilation it already supports. There is #941 and PR#491 and definitely some others, most closed with "not going to happen anytime soon" message. Sad.
With all the complications, it looks like I will be better of buying some ARM laptop for shipping applications based on Javascript on the embedded systems.
This is a 91th post of #100daystooffload.