develooper Front page | perl.perl5.porters | Postings from January 2019

[perl #133787] perl-5.29.6 fails to build on Android 8.1 (Oreo)under Termux app environment

Thread Next
From:
Richard
Date:
January 25, 2019 05:52
Subject:
[perl #133787] perl-5.29.6 fails to build on Android 8.1 (Oreo)under Termux app environment
Message ID:
rt-4.0.24-8358-1548034345-1136.133787-75-0@perl.org
# New Ticket Created by  Richard 
# Please include the string:  [perl #133787]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133787 >


The CCTools app mentioned in README.android isn't currently available in
the Google Play store, so I'm instead using the Termux app (
https://termux.com/) to attempt a native build. (Termux does have a Perl
package, but it looks to have been cross-compiled rather than natively
built.)

The 4 build errors encountered when trying to "make minitest" are for
"unknown type name 'nl_item'":

In file included from ./perl.h:5288:
./proto.h:4496:43: error: unknown type name 'nl_item'
STATIC const char*      S_my_nl_langinfo(const nl_item item, bool toggle);
                                               ^
./proto.h:4500:47: error: unknown type name 'nl_item'
PERL_CALLCONV const char*       Perl_langinfo(const nl_item item);
                                                    ^
locale.c:2416:21: error: unknown type name 'nl_item'
Perl_langinfo(const nl_item item)
                    ^
locale.c:2426:24: error: unknown type name 'nl_item'
S_my_nl_langinfo(const nl_item item, bool toggle)
                       ^

The Android C library has an apparently dummy definition for 'nl_item':
https://android.googlesource.com/platform/bionic/+/master/libc/include/nl_types.h

<langinfo.h> nl_langinfo/nl_langinfo_l functions entered Android's libc in
Oreo 8.0 release
https://github.com/aosp-mirror/platform_bionic/blob/master/docs/status.md

And the libandroid-support package (installed by default) attempts to
supplement this functionality:
https://github.com/termux/libandroid-support/blob/master/include/langinfo.h

I'm new to troubleshooting the build process - and building on Android - so
the solution might be something trivial.

(kwh did suggest trying to build without locales (IIRC) on IRC before
Christmas, but the switches he suggested (and I've since forgotten) did not
result in a successful build at the time.)

Any suggestions gratefully received.
---

Summary of my perl5 (revision 5 version 29 subversion 6) configuration:

  Platform:
    osname=android
    osvers=8.1.0
    archname=aarch64-android
    uname='linux localhost 4.4.114 #1 smp preempt thu nov 8 14:28:26 cst
2018 aarch64 android '
    config_args='-des -Dusedevel'
    hint=previous
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fno-strict-aliasing -pipe -fstack-protector-strong
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fno-strict-aliasing -pipe -fstack-protector-strong'
    ccversion=''
    gccversion='4.2.1 Compatible Clang 7.0.1 (tags/RELEASE_701/final)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=1
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=
  Linker and Libraries:
    ld='cc'
    ldflags =' -L/system/lib -fstack-protector-strong'
    libpth=/system/lib /vendor/lib /data/data/com.termux/files/usr/include
/data/data/com.termux/files/usr/lib
/data/data/com.termux/files/usr/lib/clang/7.0.0
/data/data/com.termux/files/usr/bin/../lib
/data/data/com.termux/files/usr/lib /data/data/com.termux/files/usr/lib
    libs=-lpthread -ldb -ldl -lm -lutil -lc -landroid-support
    perllibs=-lpthread -ldl -lm -lutil -lc -landroid-support
    libc=/system/lib/libc.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/system/lib -fstack-protector-strong'


---

Environment:

LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib
LANG=en_US.UTF-8
PREFIX=/data/data/com.termux/files/usr
USER=u0_a56
PWD=/data/data/com.termux/files/home
HOME=/data/data/com.termux/files/home
TMPDIR=/data/data/com.termux/files/usr/tmp
SHELL=/data/data/com.termux/files/usr/bin/bash
TERM=xterm
SHLVL=1
ANDROID_ROOT=/system
ANDROID_DATA=/data
LOGNAME=u0_a56
EXTERNAL_STORAGE=/sdcard
PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
_=/data/data/com.termux/files/usr/bin/env


---


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About