Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1459

OpenSSL library defaults to dynamic linking when libcrypto.a is not found



    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: crypto
    • Labels:


      Closely related to bug: https://bugs.erlang.org/browse/ERL-1408

      It seems that when building on Android with options :

      --with-ssl=/path/to/ssl \

      When libcrypto.a is not found, the default behavior is to build using dynamic linking which makes no sense. To prove this, when passing options:

      ./otp_build configure \ 
       --xcomp-conf=./xcomp/erl-xcomp-arm64-android.conf \
       --with-ssl=/home/user/openssl \

      If the libcrypto.a file is not located in /home/user/openssl/lib then the file otp/lib/crypto/c_src/aarch64-unknown-linux-android/Makefile will contain the following:


      If this option is changed to no manually, the system behaves like expected and it tries to statically link libcrypto.a


      I have a feeling that this is related to file: /home/daniel/otp/lib/crypto/configure.in , however upon different modifications it still produces the same output Makefile.

      The output of configure for crypto is:

      === Running configure in /home/daniel/otp/lib/crypto ===
      ./configure '--build=x86_64-unknown-linux-gnu' '--host=aarch64-linux-android' '--disable-hipe' '--without-termcap' '--without-wx' '--enable-builtin-zlib' 'CC=aarch64-linux-android21-clang' 'CXX=aarch64-linux-android21-clang++' 'LD=aarch64-linux-android-ld' 'erl_xcomp_sysroot=/home/daniel/Android/Sdk/ndk/21.3.6528147/sysroot' '--with-ssl=/home/daniel/Downloads/openssl-1.1.1h' '--disable-dynamic-ssl-lib' CFLAGS='-g -O2' --disable-option-checking --cache-file=/dev/null --srcdir="/home/daniel/otp/lib/crypto"
      checking build system type... x86_64-unknown-linux-gnu
      checking host system type... aarch64-unknown-linux-android
      checking for aarch64-linux-android-gcc... aarch64-linux-android21-clang
      checking whether the C compiler works... yes
      checking for C compiler default output file name... a.out
      checking for suffix of executables... 
      checking whether we are cross compiling... yes
      checking for suffix of object files... o
      checking whether we are using the GNU C compiler... yes
      checking whether aarch64-linux-android21-clang accepts -g... yes
      checking for aarch64-linux-android21-clang option to accept ISO C89... none needed
      checking for mixed mingw-gcc and native VC++ environment... no
      checking for mixed cygwin and native MinGW environment... no
      checking if we mix cygwin with any native compiler... no
      checking if we mix msys with another native compiler... no
      checking if we mix WSL with another native compiler... no
      checking how to run the C preprocessor... aarch64-linux-android21-clang -E
      checking for grep that handles long lines and -e... /bin/grep
      checking for egrep... /bin/grep -E
      checking for ANSI C header files... yes
      checking for sys/types.h... yes
      checking for sys/stat.h... yes
      checking for stdlib.h... yes
      checking for string.h... yes
      checking for memory.h... yes
      checking for strings.h... yes
      checking for inttypes.h... yes
      checking for stdint.h... yes
      checking for unistd.h... yes
      checking for native win32 threads... no
      checking for pthread_create in -lpthread... no
      checking for pthread_create in -lc_r... no
      checking for pthread_create... yes
      checking for aarch64-linux-android-getconf... false
      checking for aarch64-linux-android-getconf... no
      checking for getconf... no
      checking for Native POSIX Thread Library... cross
      checking nptl/pthread.h usability... no
      checking nptl/pthread.h presence... no
      checking for nptl/pthread.h... no
      checking pthread.h usability... yes
      checking pthread.h presence... yes
      checking for pthread.h... yes
      checking pthread/mit/pthread.h usability... no
      checking pthread/mit/pthread.h presence... no
      checking for pthread/mit/pthread.h... no
      checking if we can add -Wdeclaration-after-statement to DED_WARN_FLAGS (via CFLAGS)... yes
      checking if we can add -Werror=return-type to DED_WERRORFLAGS (via CFLAGS)... yes
      checking if we can add -Werror=implicit to DED_WERRORFLAGS (via CFLAGS)... yes
      checking if we can add -Werror=undef to DED_WERRORFLAGS (via CFLAGS)... yes
      checking if we can add -fno-common to DED_CFLAGS (via CFLAGS)... yes
      checking for aarch64-linux-android-ld... aarch64-linux-android21-clang
      checking for static compiler flags... -Werror=undef -Werror=implicit -Werror=return-type -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -fno-common -g -O2 -D_GNU_SOURCE -DSTATIC_ERLANG_NIF -DSTATIC_ERLANG_DRIVER
      checking for basic compiler flags for loadable drivers... -fno-common -g -O2 -D_GNU_SOURCE -fPIC
      checking for compiler flags for loadable drivers... -Werror=undef -Werror=implicit -Werror=return-type -Wdeclaration-after-statement -Wall -Wstrict-prototypes -Wmissing-prototypes -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -fno-common -g -O2 -D_GNU_SOURCE -fPIC
      checking for linker for loadable drivers... aarch64-linux-android21-clang
      checking for linker flags for loadable drivers... -shared -Wl,-Bsymbolic
      checking for 'runtime library path' linker flag... -Wl,-R
      checking size of void *... 8
      checking for static ZLib to be used by SSL in standard locations... no
      checking for OpenSSL kerberos 5 support... no
      checking for ssl runtime library path to use... 
      configure: creating ./config.status
      config.status: creating c_src/aarch64-unknown-linux-android/Makefile
      configure: WARNING: result yes guessed because of cross compilation
      configure: WARNING: Cannot set run path during linking




            hans Hans Nilsson
            d4no0 D4no0
            0 Vote for this issue
            2 Start watching this issue