From: Thomas Petazzoni Date: Sat, 22 Feb 2014 22:23:33 +0000 (+0100) Subject: pixman: add patch to fix Microblaze build failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a9baea4345625f6f00fc59395faec83e08346015;p=buildroot.git pixman: add patch to fix Microblaze build failure The Microblaze build of pixman was failing due to FE_DIVBYZERO not being implemented. It turns out that the usage of it, like fenv.h and feenableexcept() is optional. So the patch simply adds a configure check and disables the appropriate code (which is only use in the tests anyway). This commit also renames the existing patch to follow the patch naming convention, and get a reliable ordering when applying patches. Fixes: http://autobuild.buildroot.org/results/806/8064092cdbac85fbf4322429d29d5d11dc51860f/ Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- diff --git a/package/pixman/pixman-01-loongson-cflags.patch b/package/pixman/pixman-01-loongson-cflags.patch new file mode 100644 index 0000000000..fc53be234e --- /dev/null +++ b/package/pixman/pixman-01-loongson-cflags.patch @@ -0,0 +1,38 @@ +configure.ac: Verify that the Loongson MMI code can link + +The Loongson MMI code modifies -march and as a result it breaks linking +when the rest of the code is built with a different -match/-mtune. +This patch fixes the problem by trying to link the code instead of just +compiling it. This patch is already committed upstream. + +Signed-off-by: Markos Chandras + +From d77d75cc6e5de14d027d22b70389a4d0c71048b9 Mon Sep 17 00:00:00 2001 +From: Markos Chandras +Date: Wed, 15 May 2013 16:51:20 +0000 +Subject: Use AC_LINK_IFELSE to check if the Loongson MMI code can link + +The Loongson code is compiled with -march=loongson2f to enable the MMI +instructions, but binutils refuses to link object code compiled with +different -march settings, leading to link failures later in the +compile. This avoids that problem by checking if we can link code +compiled for Loongson. + +Reviewed-by: Matt Turner +Signed-off-by: Markos Chandras +--- +diff --git a/configure.ac b/configure.ac +index c43a0d2..221179f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -279,7 +279,7 @@ AC_MSG_CHECKING(whether to use Loongson MMI assembler) + + xserver_save_CFLAGS=$CFLAGS + CFLAGS=" $LS_CFLAGS $CFLAGS -I$srcdir" +-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ++AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #ifndef __mips_loongson_vector_rev + #error "Loongson Multimedia Instructions are only available on Loongson" + #endif +-- +cgit v0.9.0.2-2-gbebe diff --git a/package/pixman/pixman-02-check-fe-divbyzero.patch b/package/pixman/pixman-02-check-fe-divbyzero.patch new file mode 100644 index 0000000000..44dd6913ed --- /dev/null +++ b/package/pixman/pixman-02-check-fe-divbyzero.patch @@ -0,0 +1,41 @@ +Add a check for FE_DIVBYZERO + +Some architectures (namely Microblaze) do have fenv.h and +feenableexcept, but they don't have the FE_DIVBYZERO definition. This +patch adds a configure check for FE_DIVBYZERO, and only uses it if +it's available. + +Signed-off-by: Thomas Petazzoni + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -838,6 +838,11 @@ + AC_DEFINE(HAVE_FEENABLEEXCEPT, 1, [Whether we have feenableexcept()]) + fi + ++AC_CHECK_DECL([FE_DIVBYZERO], [], [], [[#include ]]) ++if test x$have_fe_divbyzero = xyes; then ++ AC_DEFINE(HAVE_FEDIVBYZERO, 1, [Whether we have FE_DIVBYZERO]) ++fi ++ + AC_CHECK_FUNC(gettimeofday, have_gettimeofday=yes, have_gettimeofday=no) + AC_CHECK_HEADER(sys/time.h, have_sys_time_h=yes, have_sys_time_h=no) + if test x$have_gettimeofday = xyes && test x$have_sys_time_h = xyes; then +Index: b/test/utils.c +=================================================================== +--- a/test/utils.c ++++ b/test/utils.c +@@ -776,9 +776,11 @@ + { + #ifdef HAVE_FENV_H + #ifdef HAVE_FEENABLEEXCEPT ++#ifdef HAVE_FE_DIVBYZERO + feenableexcept (FE_DIVBYZERO); + #endif + #endif ++#endif + } + + void * diff --git a/package/pixman/pixman-loongson-cflags.patch b/package/pixman/pixman-loongson-cflags.patch deleted file mode 100644 index fc53be234e..0000000000 --- a/package/pixman/pixman-loongson-cflags.patch +++ /dev/null @@ -1,38 +0,0 @@ -configure.ac: Verify that the Loongson MMI code can link - -The Loongson MMI code modifies -march and as a result it breaks linking -when the rest of the code is built with a different -match/-mtune. -This patch fixes the problem by trying to link the code instead of just -compiling it. This patch is already committed upstream. - -Signed-off-by: Markos Chandras - -From d77d75cc6e5de14d027d22b70389a4d0c71048b9 Mon Sep 17 00:00:00 2001 -From: Markos Chandras -Date: Wed, 15 May 2013 16:51:20 +0000 -Subject: Use AC_LINK_IFELSE to check if the Loongson MMI code can link - -The Loongson code is compiled with -march=loongson2f to enable the MMI -instructions, but binutils refuses to link object code compiled with -different -march settings, leading to link failures later in the -compile. This avoids that problem by checking if we can link code -compiled for Loongson. - -Reviewed-by: Matt Turner -Signed-off-by: Markos Chandras ---- -diff --git a/configure.ac b/configure.ac -index c43a0d2..221179f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -279,7 +279,7 @@ AC_MSG_CHECKING(whether to use Loongson MMI assembler) - - xserver_save_CFLAGS=$CFLAGS - CFLAGS=" $LS_CFLAGS $CFLAGS -I$srcdir" --AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ -+AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #ifndef __mips_loongson_vector_rev - #error "Loongson Multimedia Instructions are only available on Loongson" - #endif --- -cgit v0.9.0.2-2-gbebe