]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/mesa3d/0004-Fix-endianess-detection-with-musl-based-toolchains.patch
Merge branch 'next'
[coffee/buildroot.git] / package / mesa3d / 0004-Fix-endianess-detection-with-musl-based-toolchains.patch
1 From 61b076689b6308b1c9d0d84ee8654a47e65e67ae Mon Sep 17 00:00:00 2001
2 From: Bernd Kuhls <bernd.kuhls@t-online.de>
3 Date: Fri, 4 Nov 2016 19:44:37 +0100
4 Subject: [PATCH 1/1] Fix endianess detection with musl-based toolchains
5
6 Musl does not define __GLIBC__ and will not provide a __MUSL__ macro:
7 http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
8
9 This patch checks for the presence of endian.h and promotes the result
10 to src/amd/Makefile.addrlib.am which executes the broken build command.
11 Fixes compile errors detected by the autobuilder infrastructure of the
12 buildroot project:
13
14 http://autobuild.buildroot.net/results/e27/e27a9a95f72dba3076549beb2a2ccfdbea2fcfee/
15 http://autobuild.buildroot.net/results/e27/e27a9a95f72dba3076549beb2a2ccfdbea2fcfee/
16
17 Patch sent upstream: https://patchwork.freedesktop.org/patch/119961/
18
19 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
20 ---
21  configure.ac                | 1 +
22  src/amd/Makefile.addrlib.am | 1 +
23  src/util/u_endian.h         | 2 +-
24  3 files changed, 3 insertions(+), 1 deletion(-)
25
26 diff --git a/configure.ac b/configure.ac
27 index 4761c59..7991b52 100644
28 --- a/configure.ac
29 +++ b/configure.ac
30 @@ -786,6 +786,7 @@ fi
31  AC_HEADER_MAJOR
32  AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
33  AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
34 +AC_CHECK_HEADER([endian.h], [DEFINES="$DEFINES -DHAVE_ENDIAN_H"])
35  AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
36  AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
37  
38 diff --git a/src/amd/Makefile.addrlib.am b/src/amd/Makefile.addrlib.am
39 index 64823fc..4e2fb1d 100644
40 --- a/src/amd/Makefile.addrlib.am
41 +++ b/src/amd/Makefile.addrlib.am
42 @@ -28,6 +28,7 @@ addrlib_libamdgpu_addrlib_la_CPPFLAGS = \
43         -I$(srcdir)/addrlib/core \
44         -I$(srcdir)/addrlib/inc/chip/r800 \
45         -I$(srcdir)/addrlib/r800/chip \
46 +       $(DEFINES) \
47         -DBRAHMA_BUILD=1
48  
49  addrlib_libamdgpu_addrlib_la_CXXFLAGS = \
50 diff --git a/src/util/u_endian.h b/src/util/u_endian.h
51 index b9d563d..266fb4a 100644
52 --- a/src/util/u_endian.h
53 +++ b/src/util/u_endian.h
54 @@ -27,7 +27,7 @@
55  #ifndef U_ENDIAN_H
56  #define U_ENDIAN_H
57  
58 -#if defined(__GLIBC__) || defined(ANDROID)
59 +#if defined(__GLIBC__) || defined(ANDROID) || defined(HAVE_ENDIAN_H)
60  #include <endian.h>
61  
62  #if __BYTE_ORDER == __LITTLE_ENDIAN
63 -- 
64 2.10.1
65