From f74ddc6df4819cfdaab0df570b9b5c3d2a5db135 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 9 Jul 2016 01:00:54 -0700 Subject: piglit: Fix build on musl/arm (From OE-Core rev: 336c1caeb86996cd316256ad15f392b9597ae414) Signed-off-by: Khem Raj Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- ...e-FE_UPWARD-only-if-its-defined-in-fenv.h.patch | 54 ++++++++++++++++++++++ meta/recipes-graphics/piglit/piglit_git.bb | 1 + 2 files changed, 55 insertions(+) create mode 100644 meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch new file mode 100644 index 0000000000..f851a92ceb --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch @@ -0,0 +1,54 @@ +From 0fc2c2932699cfd68be96c820fddfdd79b48b788 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 9 Jul 2016 07:52:19 +0000 +Subject: [PATCH] tests: Use FE_UPWARD only if its defined in fenv.h + +On ARM, musl does not define FE_* when arch does not have +VFP, (which is right interpretation), therefore check if +its defined before using it + +Fixes errors like + +tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared (first use in this function) + ret = fesetround(FE_UPWARD); + ^~~~~~~~~ + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + tests/general/roundmode-getintegerv.c | 2 ++ + tests/general/roundmode-pixelstore.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/tests/general/roundmode-getintegerv.c b/tests/general/roundmode-getintegerv.c +index 28ecfaf..5c27579 100644 +--- a/tests/general/roundmode-getintegerv.c ++++ b/tests/general/roundmode-getintegerv.c +@@ -81,7 +81,9 @@ piglit_init(int argc, char **argv) + { + int ret; + bool pass = true; ++#ifdef FE_UPWARD + ret = fesetround(FE_UPWARD); ++#endif + if (ret != 0) { + printf("Couldn't set rounding mode\n"); + piglit_report_result(PIGLIT_SKIP); +diff --git a/tests/general/roundmode-pixelstore.c b/tests/general/roundmode-pixelstore.c +index 9284f43..3fcb396 100644 +--- a/tests/general/roundmode-pixelstore.c ++++ b/tests/general/roundmode-pixelstore.c +@@ -79,7 +79,9 @@ piglit_init(int argc, char **argv) + { + int ret; + bool pass = true; ++#ifdef FE_UPWARD + ret = fesetround(FE_UPWARD); ++#endif + if (ret != 0) { + printf("Couldn't set rounding mode\n"); + piglit_report_result(PIGLIT_SKIP); +-- +1.8.3.1 + diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb index f5ef364492..be54b59a1a 100644 --- a/meta/recipes-graphics/piglit/piglit_git.bb +++ b/meta/recipes-graphics/piglit/piglit_git.bb @@ -4,6 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0" SRC_URI = "git://anongit.freedesktop.org/piglit \ file://0001-cmake-install-bash-completions-in-the-right-place.patch \ + file://0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch \ " # From 2016-07-07 -- cgit 1.2.3-korg