Skip to content

Commit

Permalink
std: Set has_reliable_f16 to false for MIPS targets in build.rs
Browse files Browse the repository at this point in the history
To avoid this linker error:

    $ sudo apt install libc6-mips-cross gcc-mips-linux-gnu
    $ CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc \
      CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc \
      ./x test library/std --target mips-unknown-linux-gnu
    undefined reference to `__gnu_f2h_ieee'

You get the same linker error also with mipsel, mips64 and
mips64el toolchains.
  • Loading branch information
Martin Nordholts committed Jul 3, 2024
1 parent 67535b6 commit e6f15c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ fn main() {
("x86" | "x86_64", _) => false,
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
("powerpc" | "powerpc64", _) => false,
// Missing `__gnu_h2f_ieee` and `__gnu_f2h_ieee`
("mips" | "mips32r6" | "mips64" | "mips64r6", _) => false,
// Missing `__extendhfsf` and `__truncsfhf`
("riscv32" | "riscv64", _) => false,
// Most OSs are missing `__extendhfsf` and `__truncsfhf`
Expand Down

0 comments on commit e6f15c5

Please sign in to comment.