From: Bernd Kuhls Date: Fri, 4 Nov 2016 20:20:58 +0000 (+0100) Subject: package/mesa3d: Fix endianess detection with musl-based toolchains X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48019c68fa051d0fb02d884c13852ff8135f9385;p=buildroot.git package/mesa3d: Fix endianess detection with musl-based toolchains Fixes http://autobuild.buildroot.net/results/e27/e27a9a95f72dba3076549beb2a2ccfdbea2fcfee/ http://autobuild.buildroot.net/results/462/4629ee4813aa36de884bba2576612f909c007264/ Signed-off-by: Bernd Kuhls Signed-off-by: Thomas Petazzoni --- diff --git a/package/mesa3d/0004-Fix-endianess-detection-with-musl-based-toolchains.patch b/package/mesa3d/0004-Fix-endianess-detection-with-musl-based-toolchains.patch new file mode 100644 index 0000000000..656705b434 --- /dev/null +++ b/package/mesa3d/0004-Fix-endianess-detection-with-musl-based-toolchains.patch @@ -0,0 +1,65 @@ +From 61b076689b6308b1c9d0d84ee8654a47e65e67ae Mon Sep 17 00:00:00 2001 +From: Bernd Kuhls +Date: Fri, 4 Nov 2016 19:44:37 +0100 +Subject: [PATCH 1/1] Fix endianess detection with musl-based toolchains + +Musl does not define __GLIBC__ and will not provide a __MUSL__ macro: +http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F + +This patch checks for the presence of endian.h and promotes the result +to src/amd/Makefile.addrlib.am which executes the broken build command. +Fixes compile errors detected by the autobuilder infrastructure of the +buildroot project: + +http://autobuild.buildroot.net/results/e27/e27a9a95f72dba3076549beb2a2ccfdbea2fcfee/ +http://autobuild.buildroot.net/results/e27/e27a9a95f72dba3076549beb2a2ccfdbea2fcfee/ + +Patch sent upstream: https://patchwork.freedesktop.org/patch/119961/ + +Signed-off-by: Bernd Kuhls +--- + configure.ac | 1 + + src/amd/Makefile.addrlib.am | 1 + + src/util/u_endian.h | 2 +- + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 4761c59..7991b52 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -786,6 +786,7 @@ fi + AC_HEADER_MAJOR + AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"]) + AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"]) ++AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"]) + AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"]) + AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"]) + +diff --git a/src/amd/Makefile.addrlib.am b/src/amd/Makefile.addrlib.am +index 64823fc..4e2fb1d 100644 +--- a/src/amd/Makefile.addrlib.am ++++ b/src/amd/Makefile.addrlib.am +@@ -28,6 +28,7 @@ addrlib_libamdgpu_addrlib_la_CPPFLAGS = \ + -I$(srcdir)/addrlib/core \ + -I$(srcdir)/addrlib/inc/chip/r800 \ + -I$(srcdir)/addrlib/r800/chip \ ++ $(DEFINES) \ + -DBRAHMA_BUILD=1 + + addrlib_libamdgpu_addrlib_la_CXXFLAGS = \ +diff --git a/src/util/u_endian.h b/src/util/u_endian.h +index b9d563d..266fb4a 100644 +--- a/src/util/u_endian.h ++++ b/src/util/u_endian.h +@@ -27,7 +27,7 @@ + #ifndef U_ENDIAN_H + #define U_ENDIAN_H + +-#if defined(__GLIBC__) || defined(ANDROID) ++#if defined(__GLIBC__) || defined(ANDROID) || defined(HAVE_ENDIAN_H) + #include + + #if __BYTE_ORDER == __LITTLE_ENDIAN +-- +2.10.1 +