2017-12-22 12:37:21 +01:00
|
|
|
From 4135bd2e13880866deb0440855d1a869397e5024 Mon Sep 17 00:00:00 2001
|
2016-11-04 21:20:58 +01:00
|
|
|
From: Bernd Kuhls <bernd.kuhls@t-online.de>
|
|
|
|
Date: Fri, 4 Nov 2016 19:44:37 +0100
|
2017-12-22 12:37:21 +01:00
|
|
|
Subject: [PATCH] Fix endianess detection with musl-based toolchains
|
2016-11-04 21:20:58 +01:00
|
|
|
|
|
|
|
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 <bernd.kuhls@t-online.de>
|
2017-12-22 12:37:21 +01:00
|
|
|
[Romain: rebase on mesa 17.3.1]
|
|
|
|
Signed-off-by: Romain Naour <romain.naour@gmail.com>
|
2016-11-04 21:20:58 +01:00
|
|
|
---
|
|
|
|
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
|
2017-12-22 12:37:21 +01:00
|
|
|
index a02173f244..ee03d6f582 100644
|
2016-11-04 21:20:58 +01:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2017-12-22 12:37:21 +01:00
|
|
|
@@ -791,6 +791,7 @@ fi
|
2016-11-04 21:20:58 +01:00
|
|
|
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"])
|
2017-12-22 12:37:21 +01:00
|
|
|
AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"])
|
2016-11-04 21:20:58 +01:00
|
|
|
diff --git a/src/amd/Makefile.addrlib.am b/src/amd/Makefile.addrlib.am
|
2017-12-22 12:37:21 +01:00
|
|
|
index 46689637f9..508edfd0d5 100644
|
2016-11-04 21:20:58 +01:00
|
|
|
--- a/src/amd/Makefile.addrlib.am
|
|
|
|
+++ b/src/amd/Makefile.addrlib.am
|
2017-12-22 12:37:21 +01:00
|
|
|
@@ -30,6 +30,7 @@ addrlib_libamdgpu_addrlib_la_CPPFLAGS = \
|
2016-11-04 21:20:58 +01:00
|
|
|
-I$(srcdir)/addrlib/inc/chip/r800 \
|
2017-12-22 12:37:21 +01:00
|
|
|
-I$(srcdir)/addrlib/gfx9/chip \
|
2016-11-04 21:20:58 +01:00
|
|
|
-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
|
2017-12-22 12:37:21 +01:00
|
|
|
index 9e09f80181..038a28fac9 100644
|
2016-11-04 21:20:58 +01:00
|
|
|
--- a/src/util/u_endian.h
|
|
|
|
+++ b/src/util/u_endian.h
|
|
|
|
@@ -27,7 +27,7 @@
|
|
|
|
#ifndef U_ENDIAN_H
|
|
|
|
#define U_ENDIAN_H
|
|
|
|
|
2017-12-22 12:37:21 +01:00
|
|
|
-#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
|
|
|
|
+#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__) || defined(HAVE_ENDIAN_H)
|
2016-11-04 21:20:58 +01:00
|
|
|
#include <endian.h>
|
|
|
|
|
|
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
|
|
--
|
2017-12-22 12:37:21 +01:00
|
|
|
2.14.3
|
2016-11-04 21:20:58 +01:00
|
|
|
|