Skip to content

Not sourcing target-cpu #1584

@N-T-K

Description

@N-T-K

If TARGET = Some(thumbv7em-none-eabihf) then it is correctly mapped to:

cc-rs/src/lib.rs

Lines 2406 to 2412 in 1ca8b2a

if target.full_arch.starts_with("thumbv7em") {
cmd.args.push("-march=armv7e-m".into());
if target.abi == "eabihf" {
cmd.args.push("-mfpu=fpv4-sp-d16".into())
}
}

However, if there is a provided CARGO_ENCODED_RUSTFLAGS = Some(-Ctarget-cpu=cortex-m7) then the aforementioned cc flags are wrong and should be -march=armv7e-m+fp.dp -mfloat-abi=hard -mfpu=auto.

gcc -mcpu docs.
rustc thumbv7em-none-eabihf.

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