Skip to content

Commit

Permalink
Revert "Export fenv functions on all platforms (#213)"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maleadt committed Nov 16, 2020
1 parent b34f107 commit be31bff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amd64/fenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "bsd_fpu.h"
#include "math_private.h"

#ifndef OPENLIBM_USE_HOST_FENV_H
#ifdef _WIN32
#define __fenv_static OLM_DLLEXPORT
#endif
#include <openlibm_fenv.h>
Expand Down

0 comments on commit be31bff

Please sign in to comment.