Asdf-erlang: Install fails when using Xcode 11.4/CLT 11.4

Created on 26 Mar 2020  路  7Comments  路  Source: asdf-vm/asdf-erlang

Started working on a project with elixir and erlang dependencies and noticed that asdf install will fail to build erlang 22.3 when using Xcode 11.4/Command line tools 11.4.

Steps to reproduce:

  1. Switch to xcode 11.4 command line tools.
  2. Run 'asdf install' in project directory with specified .tool-versions file
  3. Output
elixir 1.8.2-otp-22 is already installed
Extracting source code
Building Erlang/OTP 22.3 (asdf_22.3), please wait...
Configure options have changed. Reconfiguring...
APPLICATIONS DISABLED (See: /Users/theng/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_build_22.3.log)
 * jinterface     : No Java compiler found

DOCUMENTATION INFORMATION (See: /Users/theng/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_build_22.3.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
 GEN    obj/x86_64-apple-darwin19.4.0/opt/MADE
 LD /Users/theng/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_src_22.3/bin/x86_64-apple-darwin19.4.0/erl_child_setup
ld: weak import of symbol '___darwin_check_fd_set_overflow' not supported because of option: -no_weak_imports for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/Users/theng/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_src_22.3/bin/x86_64-apple-darwin19.4.0/erl_child_setup] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

Please see /Users/theng/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_build_22.3.log for full details.

Full log: otp_build_22.3.log

Workaround:

  1. Download and install Xcode 11.3.1/command line tools 11.3.1 through dev.apple.com/downloads/more.
  2. Switch to 11.3.1 tools. sudo xcode-select -s /Library/Developer/CommandLineTools or `sudo xcode-select -s /Applications/Xcode.app/
  3. Run asdf install with .tool-versions file

Other information that may be relevant

  • Clang version included with Xcode 11.4:
/usr/bin/clang --version
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Clang version included with CLT 11.3.1
/usr/bin/clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  • The following kerl configure options were used: set -g -x KERL_CONFIGURE_OPTIONS '--disable-hipe --without-javac --with-ssl=$(brew --prefix openssl)'

Most helpful comment

@axelson
I use master
It works

asdf install erlang ref:master
asdf global erlang ref:master

All 7 comments

I got same error. Xcode 11.4

Building Erlang/OTP 22.3 (asdf_22.3), please wait...
Build failed.
 GEN    obj/x86_64-apple-darwin19.4.0/opt/MADE
 LD /Users/fahrinh/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_src_22.3/bin/x86_64-apple-darwin19.4.0/erl_child_setup
ld: weak import of symbol '___darwin_check_fd_set_overflow' not supported because of option: -no_weak_imports for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [/Users/fahrinh/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3/otp_src_22.3/bin/x86_64-apple-darwin19.4.0/erl_child_setup] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [smp] Error 2
make: *** [emulator] Error 2

I believe this is the same issue as https://github.com/kerl/kerl/issues/335. Please follow that issue for the fix. This is something that will have to be fixed in kerl.

https://bugs.erlang.org/browse/ERL-1205

The fix is merged to maint and master and will be included in the OTP 22.3.1 patch release, RC3, and OTP 23.

Thanks a lot @Stratus3D, @fahrinh.

Are there any versions of erlang that can be installed while waiting for OTP 23.1?

@axelson
I use master
It works

asdf install erlang ref:master
asdf global erlang ref:master
Was this page helpful?
0 / 5 - 0 ratings