Skip to content

OTP 24.0 unable to find crypto OpenSSL lib #4821

@jj1bdx

Description

@jj1bdx

Describe the bug

lib/crypto/configure of OTP 24.0 on macOS 10.15.7 was unable to find the shared library /usr/local/opt/openssl/lib/libcrypto.a.

(Edited: This bug was first discovered when running under parallel configure execution. Using --disable-parallel-configure solves the issue in some cases but not the root cause.)

(Edited 2: a workaround for this bug is posted as a comment here)

(Edited 3: this issue is NOT specific to macOS, reproducible on Ubuntu 20.10 when using autoconf-2.71 instead of stock autoconf-2.69)

To Reproduce

Running the following script as script.sh 24.0

#!/bin/sh
# For macOS with HomeBrew OpenSSL
OTP_VERSION=$1
# SSL path is configured in standard path of lib/crypto/configure.in
#OPENSSL_LOCAL="/usr/local/opt/openssl"
INSTALL_DIR_PREFIX="/Users/kenji/otp/"
#
env \
    CC=/usr/local/opt/ccache/libexec/clang \
    CXX=/usr/local/opt/ccache/libexec/clang++ \
    CFLAGS="-O3 -fstack-protector-strong" LDFLAGS="-fstack-protector-strong" \
    MAKEFLAGS="-j12" \
    KERL_BUILD_PLT="yes" \
    # --disable-parallel-configure required to avoid malfunction of
    # lib/crypto/configure, failing to detect libcrypto.dylib
    KERL_CONFIGURE_OPTIONS="--enable-jit --enable-m64-build --enable-darwin-64bit --disable-vm-probes --disable-native-libs --enable-kernel-poll --enable-dirty-schedulers --enable-sharing-preserving --enable-lock-counter --enable-esock --disable-sctp --without-javac --without-odbc --enable-threads --enable-smp-support --with-wx --disable-silent-rules --with-ssl --disable-dynamic-ssl-lib" \
    KERL_BUILD_DOCS="yes" \
    sh -c "(kerl build git https://github.com/jj1bdx/otp/ OTP-${OTP_VERSION} ${OTP_VERSION} && kerl install ${OTP_VERSION} ${INSTALL_DIR_PREFIX}${OTP_VERSION})"

Causes the following output (note that repository jj1bdx/otp is identical fork as erlang/otp):

% script.sh 24.0
Checking out Erlang/OTP git repository from https://github.com/jj1bdx/otp/...
Building Erlang/OTP 24.0 from git, please wait...
Configure failed.
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 -fno-common -m64 -O3 -fstack-protector-strong -fPIC -fno-common
checking for linker for loadable drivers... clang
checking for linker flags for loadable drivers... -m64 -bundle -bundle_loader /Users/kenji/.kerl/builds/24.0/otp_src_git/bin/x86_64-apple-darwin19.6.0/beam.smp
checking for 'runtime library path' linker flag... not found
checking for multiarch directory... not found
checking size of void *... 8
checking for static zlib... no
checking for OpenSSL header in /usr/local/Cellar/openssl@1.1/1.1.1k... yes
checking for OpenSSL in /usr/local/Cellar/openssl@1.1/1.1.1k... configure: error: static linking against crypto library disabled by user, but no dynamic library found in /usr/local/Cellar/openssl@1.1/1.1.1k
ERROR: /Users/kenji/.kerl/builds/24.0/otp_src_git/lib/crypto/configure failed!

Please see /Users/kenji/.kerl/builds/24.0/otp_build_git.log for full details.

Expected behavior
The build should have been ongoing properly without --disable-parallel-configure.

Affected versions
24.0

Additional context
Building without parallelism by make (without -j option) in the building directory did not cause this bug.

Even with this workaround, the build was failed as follows:

Checking out Erlang/OTP git repository from https://github.com/jj1bdx/otp/...
Building Erlang/OTP 24.0 from git, please wait...
APPLICATIONS DISABLED (See: /Users/kenji/.kerl/builds/24.0/otp_build_git.log)
 * jinterface     : Java compiler disabled by user
 * odbc           : User gave --without-odbc option

APPLICATIONS INFORMATION (See: /Users/kenji/.kerl/builds/24.0/otp_build_git.log)
 * wx             : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available

DOCUMENTATION INFORMATION (See: /Users/kenji/.kerl/builds/24.0/otp_build_git.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
gmake[4]: x86_64-apple-darwin19.6.0/Makefile: No such file or directory
gmake[4]: *** No rule to make target 'x86_64-apple-darwin19.6.0/Makefile'.  Stop.
gmake[4]: Leaving directory '/Users/kenji/.kerl/builds/24.0/otp_src_git/lib/crypto/c_src'
gmake[3]: *** [/Users/kenji/.kerl/builds/24.0/otp_src_git/make/run_make.mk:35: opt] Error 2
gmake[3]: Leaving directory '/Users/kenji/.kerl/builds/24.0/otp_src_git/lib/crypto/c_src'
gmake[2]: *** [/Users/kenji/.kerl/builds/24.0/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
gmake[2]: Leaving directory '/Users/kenji/.kerl/builds/24.0/otp_src_git/lib/crypto'
gmake[1]: *** [/Users/kenji/.kerl/builds/24.0/otp_src_git/make/otp_subdir.mk:29: opt] Error 2
gmake[1]: Leaving directory '/Users/kenji/.kerl/builds/24.0/otp_src_git/lib'
gmake: *** [Makefile:498: libs] Error 2

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions