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:
.tool-versions fileelixir 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:
sudo xcode-select -s /Library/Developer/CommandLineTools or `sudo xcode-select -s /Applications/Xcode.app/asdf install with .tool-versions fileOther information that may be relevant
/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
/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
set -g -x KERL_CONFIGURE_OPTIONS '--disable-hipe --without-javac --with-ssl=$(brew --prefix openssl)'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
Most helpful comment
@axelson
I use master
It works