Skip to content

Commit be31bff

Browse files
committed
Revert "Export fenv functions on all platforms (#213)"
The implementation of `fesetenv` cannot be portable, as the value of `FE_DFL_ENV` differs between platforms. On FreeBSD, it is a actual environment. With glibc however, it's a sentinel -1 handled in the implementation of its floating point functions. With openlibm based on FreeBSD's libm, it assumes `FE_DFL_ENV` to be an actual environment. That assumption breaks using code that was compiled against glibc, e.g., `libcuda`: ``` Thread 1 "julia-debug" received signal SIGSEGV, Segmentation fault. 0x00007ffff7b855d0 in fesetenv () from /home/tim/Julia/julia/build/release/usr/bin/../lib/libopenlibm.so (gdb) bt ``` This reverts commit 5a27b4c. Fixes JuliaLang/julia#38427.
1 parent b34f107 commit be31bff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

amd64/fenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "bsd_fpu.h"
3030
#include "math_private.h"
3131

32-
#ifndef OPENLIBM_USE_HOST_FENV_H
32+
#ifdef _WIN32
3333
#define __fenv_static OLM_DLLEXPORT
3434
#endif
3535
#include <openlibm_fenv.h>

0 commit comments

Comments
 (0)