bug-gnu-libiconv
[Top][All Lists]
Advanced

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

Re: [bug-gnu-libiconv] Compilation error when building for Android


From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] Compilation error when building for Android
Date: Sun, 08 Jan 2023 18:12:42 +0100

Hi,

Alexey Rochev wrote:
> When I try to build libiconv for Android, using Android NDK r25b, it fails
> with following error:
> 
> In file included from
> .././../src/1.17-e2a53830aa.clean/srclib/canonicalize-lgpl.c:28:
> In file included from ./stdlib.h:36:
> In file included from
> /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/local/include/stdlib.h:31:
> In file included from
> /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/stdlib.h:34:
> In file included from
> /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/malloc.h:30:
> In file included from ./stdio.h:43:
> In file included from
> /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/stdio.h:376:
> /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/bits/fortify/stdio.h:53:53:
> error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
>     return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format,
> ap);
>                                                     ^
> .././../src/1.17-e2a53830aa.clean/srclib/cdefs.h:144:48: note: expanded
> from macro '__bos'
> #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
>                                                ^

When I build it, using the (somewhat newer) header files included in the
Termux app, it succeeds and all tests pass. I use CC="clang".

What version is the '1.17-e2a53830aa.clean' that you are using?

Also, what are the values of CC, CPPFLAGS, CFLAGS that you pass? It seems
that one of them includes some FORTIFY options. What if you omit these
FORTIFY options?

> I assume that the cause of error is that libiconv uses its own copy of
> cdefs.h from glibc instead of the one present in Android NDK, and it's
> incompatible with other NDK headers.

We did have problems with cdefs.h in 2021, but no such problem is known
w.r.t. the version of cdefs.h included in libiconv 1.17.

Bruno






reply via email to

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