Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Cross-compiling can be a pain to set up, though. Sometimes it's easy, sometimes it isn't. I've definitely compiled under emulators in the past just to not have to deal with cross-compilers.

I definitely wouldn't spend $7000 to avoid the pain though!



Isn't it typically a flag, nowadays? Even for python, getting an install that works on ARM from X86 is largely `pip install --platform manylinux2014_aarch64 --only-binary=:all:`, if I have it right.

I confess it took me longer to find that flag than I'd care to admit. But AWS Lambda using ARM made this something worth finding. And many of the alternatives on how to get the artifacts to deploy did focus on containers for emulation, if I'm remembering correctly.


In theory it is a flag. However in practice it almost never works. I cross compile all the time and there is nearly always something that the developers didn't think of (probably didn't know about) that makes their code not cross compile. Automake never works right. Even Cargo often fails to get something right (and I don't know rust/cargo well enough to know how to figure out what, much less how to fix it though I suspect Cargo would fix my bug reports if I could figure out what is wrong with enough detail that they can figure out the issue). Cmake always works in my experience.

Note that I didn't mention python above. If python is acceptable performance you probably have enough power (including memory) on the target to just compile everything on that system thus avoiding cross compiling.


Fair that there are often problems. My expectations would be that nothing is flawless, with how often native builds can be difficult. Still, I thought for the common targets with minimal dependencies, it was largely a flag.

And apologies for the confusion of mentioning python. I did that largely because it was frustratingly hard to get a cross target python for a long time.


Python is doing a lot of abstracting for you. In the realm of building C/C++ software using an odd menagerie of system packages and from-source dependencies one might need to figure out the cross-build process of each dependency, and make a prefix for the cross-arch system libraries… it’s doable but the paved path is definitely narrow and there’s lots of thorns when you stray into the jungle. And then you still need to run the tests.


Apologies, my point was that for a while, getting python to go cross platform was surprisingly difficult. Specifically if you had any native included, of course.

And agreed that you needed a cross compiler with all of the necessary libraries. For common targets, I don't remember this ever being that particularly difficult with gcc?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: