Trevor Gross 016bc61312
Test building custom targets and resolve an issue probing rustc
The `rustc` probe done in our build scripts needs to pass `--target` to
get the correct configuration, which usually comes from the `TARGET`
environment variable. However, for targets specified via a `target.json`
file, `TARGET` gets set to the file name without an extension or path.
`rustc` will check a search path to attempt to locate the file, but this
is likely to fail since the directory where Cargo invokes build scripts
(and hence where those scripts invoke `rustc`) might not have any
relation to the JSON spec file.

Resolve this for now by leaving `f16` and `f128` disabled if the `rustc`
command fails. Result of the discussion at CARGO-14208 may eventually
provide a better solution.

A CI test is also added since custom JSON files are an edge case that
could fail in other ways. I verified this fails without the fix here.
The JSON file is the output for `thumbv7em-none-eabi`, just renamed so
`rustc` doesn't identify it.
2025-07-04 21:09:56 -05:00
..

libm

A Rust implementations of the C math library.

Usage

libm provides fallback implementations for Rust's float math functions in core, and the core_float_math feature. If what is available suits your needs, there is no need to add libm as a dependency.

If more functionality is needed, this crate can also be used directly:

[dependencies]
libm = "0.2.11"

Contributing

Please check CONTRIBUTING.md

Minimum Rust version policy

This crate supports rustc 1.63 and newer.

License

Usage is under the MIT license, available at https://opensource.org/license/mit.

Contribution

Contributions are licensed under both the MIT license and the Apache License, Version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as mentioned, without any additional terms or conditions.

See LICENSE.txt for full details.