Skip to content

Cross compilation #2

@davidgraeff

Description

@davidgraeff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions