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

Cross compilation #2

Open
davidgraeff opened this issue Nov 28, 2019 · 0 comments
Open

Cross compilation #2

davidgraeff opened this issue Nov 28, 2019 · 0 comments

Comments

@davidgraeff
Copy link

Would you mind adding another patch for the Makefile?
The original quickjs Makefile already allows to set a CROSS_PREFIX. But they do it in a way that it would need to be explicitly set on the command line via make -e CROSS_PREFIX=...

If you add the following line, "CROSS_PREFIX" can be set by the cargo environment:

let content = Regex::new("CROSS_PREFIX=")?.replace_all(&content, "CROSS_PREFIX?=");

This allows to compile for aarch64 as a static musl binary for example, which is currently not possible:
PATH=$PATH:/path/to/musl/gcc/aarch64/bin CROSS_PREFIX=aarch64-linux-musl- cargo build --target aarch64-unknown-linux-musl

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