bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] Build broken with the latest preview of Android NDK a


From: Chet Ramey
Subject: Re: [Bug-readline] Build broken with the latest preview of Android NDK and clang (r15 beta 2)
Date: Wed, 7 Jun 2017 16:01:23 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 6/6/17 10:13 AM, Chi-Hsuan Yen wrote:
> Hello readline experts,
> 
> I maintain a set of packages on Android. A recent change in Android's
> NDK (Native Development Kit) breaks building readline. Here are steps
> to reproduce:
> 
> (Download 
> https://dl.google.com/android/repository/android-ndk-r15-beta2-linux-x86_64.zip
> and extract to ~/tmp/)
> $ export ANDROID_NDK="$HOME/tmp/android-ndk-r15-beta2"
> $ "$ANDROID_NDK/build/tools/make_standalone_toolchain.py"
> --install-dir toolchain --api 21 --arch arm64 --unified-headers
> (git clone readline.git and cd into it)
> $ export PATH="$(pwd)/toolchain/bin:$PATH"
> $ CC="$(pwd)/toolchain/bin/aarch64-linux-android-clang"
> CROSS_COMPILE=aarch64-linux-android- ./configure
> --host=aarch64-linux-android
> $ make
> 
> It fails with:
> 
> /home/yen/Projects/tmp/readline/toolchain/bin/aarch64-linux-android-clang
> -c -DHAVE_CONFIG_H   -I. -I.  -DRL_LIBRARY_VERSION='"7.0"' -g -O
> search.c
> In file included from search.c:46:
> ./histlib.h:55:14: error: redeclaration of 'strchr' must have the
> 'overloadable' attribute
> extern char *strchr ();
>              ^
> /home/yen/Projects/tmp/readline/toolchain/bin/../sysroot/usr/include/string.h:69:7:
> note: previous overload of function is here
> char* strchr(const char* _Nonnull, int) __attribute_pure__ __overloadable
>       ^
> 1 error generated.
> make: *** [search.o] Error 1
> 
> As a workaround, I just remove the "#ifndef strchr" block from histlib.h.

Thanks for the report.  Your fix is ok for a temporary workaround; a more
complete fix might look something like

#ifndef member
#  if !defined (strchr) && !defined (__STDC__)
extern char *strchr ();
#  endif /* !strchr && !__STDC__ */
#define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
#endif

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]