Skip to content

clang build fails with "invalid version 'softfloat'" on aarch64-unknown-none-softfloat target with cc crate 1.2.17 #1441

Open
@jrm224

Description

@jrm224

When building a Rust project that uses the cc crate (version 1.2.17) for the aarch64-unknown-none-softfloat target, the build fails if clang is used as the C compiler.

The error message from clang is:

clang: error: version 'softfloat' in target triple 'aarch64-unknown-none-softfloat' is invalid

The cc crate appears to be invoking clang with the full target triple --target=aarch64-unknown-none-softfloat. It seems that some versions of clang do not accept the softfloat version string within the target triple for this architecture.

Steps to Reproduce (based on our experience):

Use a build.rs script that utilizes the cc crate (version 1.2.17).
Set the build target to aarch64-unknown-none-softfloat (either through environment variables like TARGET or by calling build.target() in the build script).
Ensure clang is selected as the C compiler (e.g., env::set_var("CC", "clang"); in build.rs or via environment variable).
Run cargo build --target aarch64-unknown-none-softfloat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions