Commit Graph

14 Commits

Author SHA1 Message Date
Tim Besard be31bff11d 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 5a27b4c0c0.

Fixes https://github.com/JuliaLang/julia/issues/38427.
2020-11-16 09:17:49 +01:00
Elliot Saba 5a27b4c0c0
Export `fenv` functions on all platforms (#213)
Win32 has been using a hack to switch the `fenv` functions from `static`
to `DLLEXPORT`, we apply that hack to all platforms that do not use a
host `fenv.h`.
2020-09-02 12:33:04 -04:00
Keno Fischer 28fb939b0d Blanket rename DLLEXPORT->OLM_DLLEXPORT 2016-03-13 21:07:55 -04:00
Keno Fischer 459b557671 Also add DLLEXPORT in fenv.c 2016-03-13 22:52:18 +00:00
Ed Schouten 42177873f8 Remove weak reference construct from fenv code.
I grepped through the FreeBSD source tree and for me, it seems to be
totally unclear why these two specific functions are weak references.
Such a construct is commonly used by FreeBSD's threading library
(libthr) to override certain functions, but I can't find any traces of
that.

Just use the function name directly. This fixes a compiler warning as
well (-Wmissing-prototypes).
2015-01-10 09:41:32 +01:00
Ed Schouten 06dbb6e72b Use more uniform style of including headers.
Put external headers before internal ones. While there, replace a lot of
occurences of "openlibm.h" with <openlibm.h>. It should be thought of as
an external header, as it is installed along with the library.
2015-01-09 14:24:24 +01:00
Ed Schouten 17688c4487 Rename include/fenv.h to <openlibm_fenv.h>.
OpenLibm has an implementation of fenv.h internally. This may be
problematic in case you want it to build against the host system's
implementation, as it would require you to somehow take the fenv.h file
out of the compiler search path.

Simply use a different naming scheme, similar to openlibm.h and
openlibm_complex.h. If we want to build against the host's fenv.h, we
can simply add an '#include <fenv.h>' from within this header.
2015-01-09 13:11:12 +01:00
Jameson Nash a076418c8b provide fegetround & family functions on win64 2014-01-13 01:10:04 -05:00
Jameson Nash 9b23967282 provide fenv functions on windows 2013-08-27 21:12:53 -04:00
Jameson Nash 3c8738e642 fix amd64 asm syntax for windows 2013-03-02 22:50:35 -05:00
Keno Fischer 87ce7cedda Fix build on amd64 linux 2012-08-19 04:15:47 -04:00
Viral B. Shah 210c1fa7b4 Add fpu.h
Build will currently fail due to amd64/fenv.c not building.
2012-08-19 13:13:52 +05:30
Viral B. Shah 16b9264f9d Import entire msun from FreeBSD. 2011-12-15 11:29:35 +05:30
Viral B. Shah aba7ae910f Initialize repo. FreeBSD 8.2 msun code + some tweaks 2011-08-13 00:31:25 +05:30