[Mesa-dev] [PATCH 2/5] android: radeonsi: fix building error in si_shader.c

Mauro Rossi issor.oruam at gmail.com
Sun Feb 14 14:41:10 UTC 2016


Hi,

thanks, now they should be ok

The macro name was changed to __STRCHRNUL_H

Tested by building marshmallow-x86
M.



>From c1fd979ee7b3e74c4d097b7b1941ebbe65f8d003 Mon Sep 17 00:00:00 2001
From: Mauro Rossi <issor.oruam at gmail.com>
Date: Sun, 14 Feb 2016 15:34:16 +0100
Subject: [PATCH 1/2] android: add support for strchrnul

Android Bionic has no strchrnul in string functions,
radeonsi uses strchrnul, so we need an implementation.

strchrnul.h is added in top mesa include path.
---
 include/strchrnul.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 include/strchrnul.h

diff --git a/include/strchrnul.h b/include/strchrnul.h
new file mode 100644
index 0000000..b22028d
--- /dev/null
+++ b/include/strchrnul.h
@@ -0,0 +1,46 @@
+/**************************************************************************
+ *
+ * Copyright (C) 2014 Emil Velikov <emil.l.velikov at gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
"Software"),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+
**************************************************************************/
+
+#ifndef __STRCHRNUL_H
+#define __STRCHRNUL_H
+
+#include <string.h>
+
+#if defined(__ANDROID__)
+
+char *
+strchrnul(const char *s, int c)
+{
+        char * result = strchr(s, c);
+
+        if (result == NULL) {
+                result = s + strlen(s);
+        }
+
+        return result;
+}
+
+#endif /* __ANDROID__ */
+
+#endif /* __STRCHRNUL_H */
-- 
2.5.0





>From e6252743efcd487a7b0d9f37712d4d41149ef0dd Mon Sep 17 00:00:00 2001
From: Mauro Rossi <issor.oruam at gmail.com>
Date: Sun, 14 Feb 2016 15:10:16 +0100
Subject: [PATCH 2/2] android: radeonsi: fix building error in si_shader.c

Android Bionic does not support strchrnul() function,
causing the following building error:

external/mesa/src/gallium/drivers/radeonsi/si_shader.c:3863: error:
undefined reference to 'strchrnul'
collect2: error: ld returned 1 exit status
---
 src/gallium/drivers/radeonsi/si_shader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/radeonsi/si_shader.c
b/src/gallium/drivers/radeonsi/si_shader.c
index 19c427a..ec26d71 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -48,6 +48,7 @@
 #include "sid.h"

 #include <errno.h>
+#include <strchrnul.h>

 static const char *scratch_rsrc_dword0_symbol =
     "SCRATCH_RSRC_DWORD0";
-- 
2.5.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160214/c65cc78a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-android-add-support-for-strchrnul.patch
Type: text/x-patch
Size: 2359 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160214/c65cc78a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-android-radeonsi-fix-building-error-in-si_shader.c.patch
Type: text/x-patch
Size: 940 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160214/c65cc78a/attachment-0001.bin>


More information about the mesa-dev mailing list