augeas icon indicating copy to clipboard operation
augeas copied to clipboard

Unable to compile in Termux

Open jose1711 opened this issue 2 years ago • 2 comments

I am getting this trying to compile in Termux:

In file included from regex.c:68:
In file included from ./regex_internal.h:25:
In file included from ./stdio.h:43:
In file included from /data/data/com.termux/files/usr/include/stdio.h:47:
In file included from ./string.h:41:
In file included from /data/data/com.termux/files/usr/include/string.h:187:
/data/data/com.termux/files/usr/include/bits/fortify/string.h:91:47: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
        __clang_error_if(__bos_unevaluated_le(__bos(dst), __builtin_strlen(src)),
                                              ^
./cdefs.h:123:48: note: expanded from macro '__bos'
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
                                               ^
In file included from regex.c:68:
In file included from ./regex_internal.h:25:
In file included from ./stdio.h:43:
In file included from /data/data/com.termux/files/usr/include/stdio.h:47:
In file included from ./string.h:41:
In file included from /data/data/com.termux/files/usr/include/string.h:187:
/data/data/com.termux/files/usr/include/bits/fortify/string.h:91:47: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
$ gcc --version                                                                                                                  62% (CHG)─╯
clang version 14.0.1
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin

jose1711 avatar Apr 27 '22 15:04 jose1711

__USE_FORTIFY_LEVEL is an internal glibc thing. While Android supports, or supported? FORTIFY_SOURCE, internally that might be implemented differently.

igalic avatar Apr 28 '22 17:04 igalic

It looks like Termux comes with its own C headers, as I see /data/data/com.termux/files/usr/include/stdio.h, /data/data/com.termux/files/usr/include/string.h, etc. And these seem to clash a bit with ./stdio.h, ./string.h and others, which appear to come from gnulib. Might be tricky to untangle.

DimitryAndric avatar Dec 08 '22 12:12 DimitryAndric