diff options
| author | Trevor Gross <tmgross@umich.edu> | 2025-04-21 09:20:37 +0000 |
|---|---|---|
| committer | Trevor Gross <t.gross35@gmail.com> | 2025-04-21 06:16:12 -0400 |
| commit | 913796c1c5f7e0afa6c4323e8bd850efd7a646d9 (patch) | |
| tree | 97acdb5b2595964c9cd318fdb636ab215171c507 | |
| parent | 94448a6ff6ac1d4af6892086ea1bc67518363e44 (diff) | |
| download | rust-913796c1c5f7e0afa6c4323e8bd850efd7a646d9.tar.gz rust-913796c1c5f7e0afa6c4323e8bd850efd7a646d9.zip | |
Fix compiler-builtins publish
compiler-builtins currently wouldn't publish correctly because of a relative path to `libm` that doesn't get included in the package. Fix this by simlinking `libm` to within the `compiler-builtins` directory. Also symlink LICENSE.txt which lets us drop the `include` array in Cargo.toml. LICENSE.txt and compiler-rt were not being included anyway, since Cargo silently drops items that are not within the crate directory.
| -rw-r--r-- | library/compiler-builtins/compiler-builtins/Cargo.toml | 10 | ||||
| l--------- | library/compiler-builtins/compiler-builtins/LICENSE.txt | 1 | ||||
| -rw-r--r-- | library/compiler-builtins/compiler-builtins/src/lib.rs | 2 | ||||
| l--------- | library/compiler-builtins/compiler-builtins/src/math/libm_math | 1 | ||||
| -rw-r--r-- | library/compiler-builtins/compiler-builtins/src/math/mod.rs (renamed from library/compiler-builtins/compiler-builtins/src/math.rs) | 9 |
5 files changed, 7 insertions, 16 deletions
diff --git a/library/compiler-builtins/compiler-builtins/Cargo.toml b/library/compiler-builtins/compiler-builtins/Cargo.toml index 9e23c75a826..1de37bd8683 100644 --- a/library/compiler-builtins/compiler-builtins/Cargo.toml +++ b/library/compiler-builtins/compiler-builtins/Cargo.toml @@ -9,16 +9,6 @@ homepage = "https://github.com/rust-lang/compiler-builtins" documentation = "https://docs.rs/compiler_builtins" edition = "2021" description = "Compiler intrinsics used by the Rust compiler." -include = [ - "../LICENSE.txt", - "../compiler-rt/*", - "/Cargo.toml", - "/build.rs", - "/configure.rs", - "/src/*", - "README.md", - "libm/src/math/*", -] links = 'compiler-rt' [lib] diff --git a/library/compiler-builtins/compiler-builtins/LICENSE.txt b/library/compiler-builtins/compiler-builtins/LICENSE.txt new file mode 120000 index 00000000000..4ab43736a83 --- /dev/null +++ b/library/compiler-builtins/compiler-builtins/LICENSE.txt @@ -0,0 +1 @@ +../LICENSE.txt \ No newline at end of file diff --git a/library/compiler-builtins/compiler-builtins/src/lib.rs b/library/compiler-builtins/compiler-builtins/src/lib.rs index 0678556037f..7523a00cf9b 100644 --- a/library/compiler-builtins/compiler-builtins/src/lib.rs +++ b/library/compiler-builtins/compiler-builtins/src/lib.rs @@ -45,7 +45,7 @@ pub mod math; pub mod mem; // `libm` expects its `support` module to be available in the crate root. -use math::libm::support; +use math::libm_math::support; #[cfg(target_arch = "arm")] pub mod arm; diff --git a/library/compiler-builtins/compiler-builtins/src/math/libm_math b/library/compiler-builtins/compiler-builtins/src/math/libm_math new file mode 120000 index 00000000000..4d65313c232 --- /dev/null +++ b/library/compiler-builtins/compiler-builtins/src/math/libm_math @@ -0,0 +1 @@ +../../../libm/src/math \ No newline at end of file diff --git a/library/compiler-builtins/compiler-builtins/src/math.rs b/library/compiler-builtins/compiler-builtins/src/math/mod.rs index 722374f8e4f..078feb9ff9e 100644 --- a/library/compiler-builtins/compiler-builtins/src/math.rs +++ b/library/compiler-builtins/compiler-builtins/src/math/mod.rs @@ -2,15 +2,14 @@ #[allow(dead_code)] #[allow(unused_imports)] #[allow(clippy::all)] -#[path = "../../libm/src/math/mod.rs"] -pub(crate) mod libm; +pub(crate) mod libm_math; macro_rules! libm_intrinsics { ($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => { intrinsics! { $( pub extern "C" fn $fun($($iid: $ity),+) -> $oty { - $crate::math::libm::$fun($($iid),+) + $crate::math::libm_math::$fun($($iid),+) } )+ } @@ -185,13 +184,13 @@ pub mod partial_availability { // allow for windows (and other targets) intrinsics! { pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 { - let r = super::libm::lgamma_r(x); + let r = super::libm_math::lgamma_r(x); *s = r.1; r.0 } pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 { - let r = super::libm::lgammaf_r(x); + let r = super::libm_math::lgammaf_r(x); *s = r.1; r.0 } |
