On 02.02.2016 07:37, Mauro Rossi wrote:
> 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
> 
> This patch embeds the code of strchrnul() in si_shader.c,
> in the same way described here:
> 
> http://lists.freedesktop.org/archives/piglit/2013-February/004798.html
> ---
>  src/gallium/drivers/radeonsi/si_shader.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c 
> b/src/gallium/drivers/radeonsi/si_shader.c
> index 2192b21..3717cfa 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -49,6 +49,24 @@
>  
>  #include <errno.h>
>  
> +#if defined(__ANDROID__)
> +/*
> + * Android Bionic has no strchrnul, which is used in 
> si_shader_dump_disassembly(),
> + * so we must fill in an implementation.
> + */
> +char *
> +strchrnul(const char *s, int c)
> +{
> +     char * result = strchr(s, c);
> +
> +     if (result == NULL) {
> +             result = s + strlen(s);
> +     }
> +
> +     return result;
> +}
> +#endif /* __ANDROID__ */
> +
>  static const char *scratch_rsrc_dword0_symbol =
>       "SCRATCH_RSRC_DWORD0";
>  
> 

It would be better to put this in a compatibility header in include/, so
it can be used elsewhere in the tree as well.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to