Skip to content
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

xx-cargo broken with xx-sdk #196

Open
milas opened this issue Dec 18, 2024 · 1 comment
Open

xx-cargo broken with xx-sdk #196

milas opened this issue Dec 18, 2024 · 1 comment

Comments

@milas
Copy link

milas commented Dec 18, 2024

When using xx-sdk (osxcross), xx-cargo tries to set an invalid var:

/usr/bin/xx-cargo: export: line 84: CARGO_TARGET_ARM64_UNKNOWN_MACOS10.16_LINKER: bad variable name

This is because the result from xx-info is arm64-apple-macos10.16, which is then transformed for the CARGO_TARGET_{triple}_LINKER env var:

export "CARGO_TARGET_$(xx-info | tr '[:lower:]' '[:upper:]' | tr - _)_LINKER=$(xx-info)-clang"


I think this needs to be aarch64-apple-darwin based on available rustc triples:

❯ rustc --print target-list | rg darwin
aarch64-apple-darwin
arm64e-apple-darwin
i686-apple-darwin
x86_64-apple-darwin
x86_64h-apple-darwin
@milas
Copy link
Author

milas commented Dec 19, 2024

Just as a note to others - there's broader problems with cross-compiling from Linux to macOS w/ Rust. The cross project might be worth looking at, but it seems to assume an amd64 host.

I got further by using xx-clang --setup-target-triple and setting env vars myself, but eventually hit issues due to needing objcopy & friends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant