Closed janrinze closed 4 years ago
Hmm, the commit that introduced the zlib build doesn't mention why it specifies the --64
explicitly. Normally I would like to have such things documented. Obviously we need to have a 64-bit build though to be linked to the other things we build 64-bit versions of.
However according to the source code it translates to a variable called "build64", which I would interpret as "build a 64-bit version". That should work fine on your architecture as well.
The actual result is that the compiler command gets the extra flag -m64
. Why doesn't that work on that aarch64 architecture?
I have little experience with building for ARM, mind you.
We will not change the OpenSSL build to ARM64 because that's simply not what we need to distribute. We target desktops, not mobile phones or embedded devices.
I am compiling for ARM64 Desktop.
janrinze@rpi8G:~$ uname -a
Linux rpi8G.local 5.4.51-v8+ #2 SMP PREEMPT Fri Jul 31 11:54:47 CEST 2020 aarch64 GNU/Linux
janrinze@rpi8G:~$ cat /etc/issue
Debian GNU/Linux bullseye/sid \n \l
So why doesn't the -m64
flag work then? I'd expect that to work fine. Would you suggest we use a different flag to build Zlib for 64-bit that works with both AMD64 and ARM64?
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
-m64 is a specific x86 compiler option.
Right, so the actual bug is that these compiler flags in zlib are not platform-independent, and don't support ARM64. Maybe we need to report this issue to zlib instead?
You're not the first to have issues compiling zlib for ARM64. But I can't tell if your errors are the same as any of the existing open issues.
ARM64 is not something we'll support ourselves. If there is an elegant solution by which we can support your case we're willing to add it as long as it isn't in the way of our own distribution, but we'll not develop that from Ultimaker. Sorry!
./projects/zlib.cmake contains a platform dependent setting '--64'.
When doing a native 64 bit build on aarch64 (rpi4 8GB) the configure command fails. Removing '--64' allows the zlib build to continue.
OpenSSL : in the file projects/openssl.cmake we find
When changed to :
that can build too.
Looks like a small set of changes to be able to build it on the Raspberry Pi 4 64bit and possibly other Aarch64 platforms.
It's still building and i hope to be able to report back on the results.