riscv-musl icon indicating copy to clipboard operation
riscv-musl copied to clipboard

fsetenv(FE_DFL_ENV) fails

Open Ruinland-ChuanTzu-Tsai opened this issue 5 years ago • 0 comments

I was running libc-test on both musl RV32 and RV64 port and I happened to find that math/fenv fails due to a segmentation fault.

It is caused by dereferencing FE_DFL_ENV, which is defined as ((const fenv_t *) -1) .

I've sent a patch to the mailing list. Yet the RV32 part is not in the upstream and I think that it's better to have a formal patch. So I attach a patch containing both RV32 and RV64 fixes here :

0001-riscv32-64-fenv.S-Fix-fesetenv-FE_DFL_ENV-failure.patch.txt

Ruinland-ChuanTzu-Tsai avatar Dec 03 '19 04:12 Ruinland-ChuanTzu-Tsai