[openssl-users] building openssl 1.1.1 using CrystaX NDK 10.3.2 (Android)

Peter Petrik peter.petrik at lutraconsulting.co.uk
Mon Sep 24 09:03:15 UTC 2018


Hi,

I want to add openssl to OSGeo4A <https://github.com/opengisch/OSGeo4A>,
which is built with CrystaX NDK.
I have run into issues building openssl, missing random functions:

arm-linux-androideabi-gcc  -I. -Icrypto/include -Iinclude
-I../openssl-1.1.1 -I../openssl-1.1.1/crypto/include -I../op
enssl-1.1.1/include -fPIC -pthread  -mandroid
--sysroot=/opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm  -march=
armv7-a -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC
-DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DO
PENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM
-DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ
256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl/16/\""
-DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -DNDEBUG -D
__ANDROID_API__=16 -MMD -MF crypto/rand/rand_unix.d.tmp -MT
crypto/rand/rand_unix.o -c -o crypto/rand/rand_unix.o ../o
penssl-1.1.1/crypto/rand/rand_unix.c
In file included from
/opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm/usr/include/sys/glibc-syscalls.h:43:0,
                from
/opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm/usr/include/crystax/bionic/libc/include/sy
s/mangled-syscall.h:34,
                from
/opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm/usr/include/sys/syscall.h:43,
                from ../openssl-1.1.1/crypto/rand/rand_unix.c:22:
../openssl-1.1.1/crypto/rand/rand_unix.c: In function 'syscall_random':
../openssl-1.1.1/crypto/rand/rand_unix.c:297:20: error: '__NR_getrandom'
undeclared (first use in this function)
    return syscall(SYS_getrandom, buf, buflen, 0);

(see attached configure.txt)

What is strange is that when I try with --with-rand-seed=none, I have the
same error message. With other rand-seed options, different methods
are missing.

Do you have any idea how to proceed here?

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20180924/7c33bbb8/attachment-0001.html>
-------------- next part --------------
Command line (with current working directory = .):

    /usr/bin/perl ../openssl-1.1.1/Configure android-arm shared no-comp no-hw no-engine --openssldir=/usr/local/ssl/16/ -D__ANDROID_API__=16

Perl information:

    /usr/bin/perl
    5.26.0 for x86_64-linux-gnu-thread-multi

Enabled features:

    aria
    asm
    async
    autoalginit
    autoerrinit
    autoload-config
    bf
    blake2
    camellia
    capieng
    cast
    chacha
    cmac
    cms
    ct
    deprecated
    des
    dgram
    dh
    dsa
    dso
    dtls
    dynamic-engine
    ec
    ec2m
    ecdh
    ecdsa
    err
    filenames
    gost
    hw(-.+)?
    idea
    makedepend
    md4
    mdc2
    multiblock
    nextprotoneg
    ocb
    ocsp
    pic
    poly1305
    posix-io
    psk
    rc2
    rc4
    rdrand
    rfc3779
    rmd160
    scrypt
    seed
    shared
    siphash
    sm2
    sm3
    sm4
    sock
    srp
    srtp
    sse2
    ssl
    static-engine
    stdio
    tests
    threads
    tls
    ts
    ui-console
    whirlpool
    tls1
    tls1-method
    tls1_1
    tls1_1-method
    tls1_2
    tls1_2-method
    tls1_3
    dtls1
    dtls1-method
    dtls1_2
    dtls1_2-method

Disabled features:

    afalgeng                [forced]  OPENSSL_NO_AFALGENG
    asan                    [default] OPENSSL_NO_ASAN
    comp                    [option]  OPENSSL_NO_COMP (skip crypto/comp)
    crypto-mdebug           [default] OPENSSL_NO_CRYPTO_MDEBUG
    crypto-mdebug-backtrace [default] OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
    devcryptoeng            [default] OPENSSL_NO_DEVCRYPTOENG
    ec_nistp_64_gcc_128     [default] OPENSSL_NO_EC_NISTP_64_GCC_128
    egd                     [default] OPENSSL_NO_EGD
    engine                  [option]  OPENSSL_NO_ENGINE (skip crypto/engine, engines)
    external-tests          [default] OPENSSL_NO_EXTERNAL_TESTS
    fuzz-libfuzzer          [default] OPENSSL_NO_FUZZ_LIBFUZZER
    fuzz-afl                [default] OPENSSL_NO_FUZZ_AFL
    heartbeats              [default] OPENSSL_NO_HEARTBEATS
    md2                     [default] OPENSSL_NO_MD2 (skip crypto/md2)
    msan                    [default] OPENSSL_NO_MSAN
    rc5                     [default] OPENSSL_NO_RC5 (skip crypto/rc5)
    sctp                    [default] OPENSSL_NO_SCTP
    ssl-trace               [default] OPENSSL_NO_SSL_TRACE
    ubsan                   [default] OPENSSL_NO_UBSAN
    unit-test               [default] OPENSSL_NO_UNIT_TEST
    weak-ssl-ciphers        [default] OPENSSL_NO_WEAK_SSL_CIPHERS
    zlib                    [default] 
    zlib-dynamic            [default] 
    ssl3                    [default] OPENSSL_NO_SSL3
    ssl3-method             [default] OPENSSL_NO_SSL3_METHOD

Config target attributes:

    AR => "ar",
    ARFLAGS => "r",
    CC => "gcc",
    CFLAGS => "-Wall -O3",
    CXX => "g++",
    CXXFLAGS => "-Wall -O3",
    HASHBANGPERL => "/usr/bin/env perl",
    RANLIB => "ranlib",
    RC => "windres",
    aes_asm_src => "aes_cbc.c aes-armv4.S bsaes-armv7.S aesv8-armx.S",
    aes_obj => "aes_cbc.o aes-armv4.o bsaes-armv7.o aesv8-armx.o",
    apps_aux_src => "",
    apps_init_src => "",
    apps_obj => "",
    bf_asm_src => "bf_enc.c",
    bf_obj => "bf_enc.o",
    bin_cflags => "-pie",
    bn_asm_src => "bn_asm.c armv4-mont.S armv4-gf2m.S",
    bn_obj => "bn_asm.o armv4-mont.o armv4-gf2m.o",
    bn_ops => "BN_LLONG RC4_CHAR",
    build_file => "Makefile",
    build_scheme => [ "unified", "unix" ],
    cast_asm_src => "c_enc.c",
    cast_obj => "c_enc.o",
    cflags => "-pthread  -mandroid --sysroot=\$(ANDROID_NDK)/platforms/android-16/arch-arm",
    chacha_asm_src => "chacha-armv4.S",
    chacha_obj => "chacha-armv4.o",
    cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c",
    cmll_obj => "camellia.o cmll_misc.o cmll_cbc.o",
    cppflags => "",
    cpuid_asm_src => "armcap.c armv4cpuid.S",
    cpuid_obj => "armcap.o armv4cpuid.o",
    cxxflags => "-std=c++11 -pthread  -mandroid --sysroot=\$(ANDROID_NDK)/platforms/android-16/arch-arm",
    defines => [  ],
    des_asm_src => "des_enc.c fcrypt_b.c",
    des_obj => "des_enc.o fcrypt_b.o",
    disable => [  ],
    dso_extension => ".so",
    dso_scheme => "dlfcn",
    ec_asm_src => "ecp_nistz256.c ecp_nistz256-armv4.S",
    ec_obj => "ecp_nistz256.o ecp_nistz256-armv4.o",
    enable => [  ],
    ex_libs => "-ldl -pthread",
    exe_extension => "",
    includes => [  ],
    keccak1600_asm_src => "keccak1600-armv4.S",
    keccak1600_obj => "keccak1600-armv4.o",
    lflags => "",
    lib_cflags => "",
    lib_cppflags => "-DOPENSSL_USE_NODELETE",
    lib_defines => [  ],
    md5_asm_src => "",
    md5_obj => "",
    modes_asm_src => "ghash-armv4.S ghashv8-armx.S",
    modes_obj => "ghash-armv4.o ghashv8-armx.o",
    module_cflags => "-fPIC",
    module_cxxflags => "",
    module_ldflags => "-Wl,-znodelete -shared -Wl,-Bsymbolic",
    padlock_asm_src => "",
    padlock_obj => "",
    perlasm_scheme => "void",
    poly1305_asm_src => "poly1305-armv4.S",
    poly1305_obj => "poly1305-armv4.o",
    rc4_asm_src => "rc4_enc.c rc4_skey.c",
    rc4_obj => "rc4_enc.o rc4_skey.o",
    rc5_asm_src => "rc5_enc.c",
    rc5_obj => "rc5_enc.o",
    rmd160_asm_src => "",
    rmd160_obj => "",
    sha1_asm_src => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S",
    sha1_obj => "sha1-armv4-large.o sha256-armv4.o sha512-armv4.o",
    shared_cflag => "-fPIC",
    shared_defflag => "-Wl,--version-script=",
    shared_defines => [  ],
    shared_extension => ".so.\$(SHLIB_VERSION_NUMBER)",
    shared_extension_simple => ".so",
    shared_ldflag => "-Wl,-znodelete -shared -Wl,-Bsymbolic",
    shared_rcflag => "",
    shared_sonameflag => "-Wl,-soname=",
    shared_target => "linux-shared",
    thread_defines => [  ],
    thread_scheme => "pthreads",
    unistd => "<unistd.h>",
    uplink_aux_src => "",
    uplink_obj => "",
    wp_asm_src => "wp_block.c",
    wp_obj => "wp_block.o",

Recorded environment:

    AR = 
    BUILDFILE = 
    CC = 
    CROSS_COMPILE = -
    CXX = ccache arm-linux-androideabi-g++ -DANDROID -mandroid  -fomit-frame-pointer --sysroot /opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm -I/home/peter/quick/OSGeo4A/stage/armeabi-v7a/include -L/opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -isystem /opt/crystax-ndk-10.3.2/sources/cxx-stl/gnu-libstdc++/4.9/include                            -isystem /opt/crystax-ndk-10.3.2/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include                            -isystem /opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm/usr/include
    HASHBANGPERL = 
    OPENSSL_LOCAL_CONFIG_DIR = 
    PERL = 
    RANLIB = arm-linux-androideabi-ranlib
    RC = 
    WINDRES = 
    __CNF_CFLAGS =  -march=armv7-a
    __CNF_CPPDEFINES = 
    __CNF_CPPFLAGS = 
    __CNF_CPPINCLUDES = 
    __CNF_CXXFLAGS =  -march=armv7-a
    __CNF_LDFLAGS = 
    __CNF_LDLIBS = 

Makevars:

    AR              = arm-linux-androideabi-ar
    ARFLAGS         = r
    CC              = arm-linux-androideabi-gcc
    CFLAGS          = -Wall -O3
    CPPDEFINES      = __ANDROID_API__=16
    CPPFLAGS        = 
    CPPINCLUDES     = 
    CROSS_COMPILE   = arm-linux-androideabi-
    CXX             = arm-linux-androideabi-ccache arm-linux-androideabi-g++ -DANDROID -mandroid  -fomit-frame-pointer --sysroot /opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm -I/home/peter/quick/OSGeo4A/stage/armeabi-v7a/include -L/opt/crystax-ndk-10.3.2/sources/crystax/libs/armeabi-v7a -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb -isystem /opt/crystax-ndk-10.3.2/sources/cxx-stl/gnu-libstdc++/4.9/include                            -isystem /opt/crystax-ndk-10.3.2/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include                            -isystem /opt/crystax-ndk-10.3.2/platforms/android-16/arch-arm/usr/include
    CXXFLAGS        = -Wall -O3
    HASHBANGPERL    = /usr/bin/env perl
    LDFLAGS         = 
    LDLIBS          = 
    PERL            = /usr/bin/perl
    RANLIB          = arm-linux-androideabi-arm-linux-androideabi-ranlib
    RC              = arm-linux-androideabi-windres

NOTE: These variables only represent the configuration view.  The build file
template may have processed these variables further, please have a look at the
build file for more exact data:
    Makefile

build file:

    Makefile

build file templates:

    ../openssl-1.1.1/Configurations/common0.tmpl
    ../openssl-1.1.1/Configurations/unix-Makefile.tmpl
    ../openssl-1.1.1/Configurations/common.tmpl
Operating system: armv7-whatever-android
Configuring OpenSSL version 1.1.1 (0x1010100fL) for android-arm
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile


More information about the openssl-users mailing list