-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cross-compiling to aarch64-unkown-linux-{gnu,musl}
from x86_64-linux
#268
Comments
I had similar issues in getting cross compilation from After many variations, I found that carefully setting some env variables to point to the right cross compiler for cc seems to work. Here's the example setup I got working. and inline `flake.nix` for posterity
While I've defined a custom IMO, it seems like a bug that naersk doesn't handle this for me when I do a EDIT: unfortunately, this doesn't quite work completely. As soon as I add some macos frameworks in
Probably being picked up via the wrapper for the compiler incorrectly. |
Hello!
I am trying to do a cross-build to ARM64 from my standard x86_64 PC, but failing in the process.
I have set up this minimal reproducer: https://github.com/viperML/cross-naersk
The same linking errors appear by trying to do
nix develop + cargo build
manually.I am already creating a toolchain with fenix that includes the target, and passing the env variable
CARGO_BUILD_TARGET
, but I think the problem is that the build environment uses some cc/binutils that is not suitable for the task.Moreover, the examples cover how to build to a different target (-musl) of the same architecture, but not between architectures (Utimately I want to crossbuild to ARM64 and statically link against musl, but first thing first...)
EDIT:
I added a new branch that uses pkgsCross and callPackages naersk directly. It successfully crossbuilds a
rustPlatorm
-based package, while fails to findcc
with naerskThe text was updated successfully, but these errors were encountered: