Hello.
I would like to cross-compile a binary for ARM64 (aarch64) target from my x86-64 system. I don't have native ARM64 system at hand.
Target x86_64 works fine:
Target x86 works fine too:
However target aarch64 fails with strange error:
Looks like there is an error in the system header file. How can I fix this? Is it even possible, with FreeBSD, to cross-compile ARM64 binary form the x64 system?
Sorry, I'm more familiar with Linux. And, on Linux, installing the
Is there something similar for FreeBSD platform?
Thank you and best regards!
My system is:
I would like to cross-compile a binary for ARM64 (aarch64) target from my x86-64 system. I don't have native ARM64 system at hand.
Target x86_64 works fine:
Code:
$ cc -target x86_64-unknown-freebsd -c -o platform.o platform.c
Target x86 works fine too:
Code:
$ cc -target i686-unknown-freebsd -c -o platform.o platform.c
However target aarch64 fails with strange error:
Code:
$ cc -target aarch64-unknown-freebsd -c -o platform.o platform.c
In file included from platform.c:13:
In file included from /usr/include/signal.h:43:
/usr/include/sys/_ucontext.h:46:2: error: unknown type name 'mcontext_t'
mcontext_t uc_mcontext;
^
1 error generated.
Looks like there is an error in the system header file. How can I fix this? Is it even possible, with FreeBSD, to cross-compile ARM64 binary form the x64 system?
Sorry, I'm more familiar with Linux. And, on Linux, installing the
crossbuild-essential-arm64
package gives me cross-compiler that will happily create ARM64 binary on the x64 system.Is there something similar for FreeBSD platform?
Thank you and best regards!
My system is:
Code:
FreeBSD 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64