diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-11-06 22:19:38 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2016-11-06 22:21:07 +0100 |
commit | a1ca3dcb590852880770fe879ea59b6d8222b010 (patch) | |
tree | 200cb3318981568713fe850f647b68b0c76bf03e /package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch | |
parent | d02655cd2157636d6150daf3a1344b25141780c1 (diff) | |
download | buildroot-a1ca3dcb590852880770fe879ea59b6d8222b010.tar.gz buildroot-a1ca3dcb590852880770fe879ea59b6d8222b010.zip |
jamvm: fix build with uClibc on i386/x86_64
Commit 0b6b67f34d6d4aeb340bbca579dbf85363c3f4ea ("jamvm: add patch to
fix musl build") introduced a patch to fix the jamvm build with the
musl C library. While the commit log pretends that the build was still
working with uClibc, it is not correct: it no longer builds fine with
uClibc on i386/x86_64, because the Buildroot default configuration for
uClibc doesn't enable <fenv.h> support.
Therefore this commit adapts the patch to use <fenv.h> if available
(which is the case with musl), and otherwise fall back to
<fpu_control.h>, which is available in uClibc.
Thanks to Waldemar for the investigation.
Fixes:
http://autobuild.buildroot.net/results/325a50d15e1836b31df4e84ba83b296abfb73041/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch')
-rw-r--r-- | package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch b/package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch deleted file mode 100644 index 50f95cde57..0000000000 --- a/package/jamvm/0001-Use-fenv.h-instead-of-fpu_control.h.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 7152ded5219453c9ff1cd062cecbeaf4d77e4cab Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> -Date: Thu, 26 May 2016 15:05:48 +0200 -Subject: [PATCH] Use <fenv.h> instead of <fpu_control.h> - -musl libc (http://musl-libc.org lack the non-standard <fpu_control.h> -header, which is used in src/os/linux/{i386,x86_64}/init.c files to -setup the floating point precision. This patch makes it use the -standard C <fenv.h> header instead. - -Original patch at Felix Janda at -https://sourceforge.net/p/jamvm/patches/6/. - -Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---- - src/os/linux/i386/init.c | 12 ++++++------ - src/os/linux/x86_64/init.c | 16 ++++++---------- - 2 files changed, 12 insertions(+), 16 deletions(-) - -diff --git a/src/os/linux/i386/init.c b/src/os/linux/i386/init.c -index d9c6648..94a733e 100644 ---- a/src/os/linux/i386/init.c -+++ b/src/os/linux/i386/init.c -@@ -19,18 +19,18 @@ - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - --#include <fpu_control.h> -+#include <fenv.h> - - /* Change floating point precision to double (64-bit) from - * the extended (80-bit) Linux default. */ - - void setDoublePrecision() { -- fpu_control_t cw; -+ fenv_t fenv; - -- _FPU_GETCW(cw); -- cw &= ~_FPU_EXTENDED; -- cw |= _FPU_DOUBLE; -- _FPU_SETCW(cw); -+ fegetenv(&fenv); -+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */ -+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */ -+ fesetenv(&fenv); - } - - void initialisePlatform() { -diff --git a/src/os/linux/x86_64/init.c b/src/os/linux/x86_64/init.c -index 9d55229..a76a923 100644 ---- a/src/os/linux/x86_64/init.c -+++ b/src/os/linux/x86_64/init.c -@@ -19,9 +19,7 @@ - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - --#ifdef __linux__ --#include <fpu_control.h> --#endif -+#include <fenv.h> - - /* Change the x87 FPU precision to double (64-bit) from the extended - (80-bit) Linux default. Note, unlike on i386, my testcases pass -@@ -30,14 +28,12 @@ - */ - - void setDoublePrecision() { --#ifdef __linux__ -- fpu_control_t cw; -+ fenv_t fenv; - -- _FPU_GETCW(cw); -- cw &= ~_FPU_EXTENDED; -- cw |= _FPU_DOUBLE; -- _FPU_SETCW(cw); --#endif -+ fegetenv(&fenv); -+ fenv.__control_word &= ~0x300; /*_FPU_EXTENDED */ -+ fenv.__control_word |= 0x200; /*_FPU_DOUBLE */ -+ fesetenv(&fenv); - } - - void initialisePlatform() { --- -2.7.4 - |