Skip to content

CC not resolve to correct arch for xtensa espidf arch by default even if explicitly build targetted #1552

@sansmoraxz

Description

@sansmoraxz

This actually threw me off and made me go on a wild goose chase. So the packages compiled by setting --target to viz xtensa-esp32s3-espidf, compiles rust code for the target arch but not the dependencies built using C via the cc crate.

So, at the linker stage I was facing issues with mismatch arch for rlib.

Managed to workaround this by explicitly setting env var export CROSS_COMPILE="xtensa-esp32s3-elf", but IMO this should be the default behavior, use the target arch's compiler rather than the host's compiler.

To further make this seamless, it should use the resolved binary name from PATH var, and if not found have some sort of autodiscovery (like how Windows MSVC is done), failing which throw some sort of error message that the required compiler was not found, rather than using a wrong compiler

Ref: mlua-rs/mlua#642

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions