M2芯片macOS 13.2.1下brew安装openssl@1.1失败求助
在macOS M2上通过Brew编译安装openssl@1.1时make步骤失败
系统环境
- macOS Ventura 13.2.1
- Apple M2 Max
Darwin mbp 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 arm64
Brew版本
Homebrew 4.0.3-140-gba8fd26 Homebrew/homebrew-core (git revision 955021b2c36; last commit 2023-02-24) Homebrew/homebrew-cask (git revision 080a0c1e1c; last commit 2023-02-24)
问题详情
执行brew install openssl@1.1或安装依赖openssl@1.1的软件(如openjdk、gradle)时出现报错,核心表现为make过程中编译进程被系统终止:
==> Fetching openssl@1.1 Warning: Building openssl@1.1 from source as the bottle needs: - HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Users/someuser/homebrew/Cellar) - HOMEBREW_PREFIX: /opt/homebrew (yours is /Users/someuser/homebrew) ==> Downloading https://www.openssl.org/source/openssl-1.1.1t.tar.gz Already downloaded: /Users/someuser/Library/Caches/Homebrew/downloads/ec3feb171aa63b32c30a6e7423e78f743f92d1ef984b66b0ea548d08220c0ce6--openssl-1.1.1t.tar.gz ==> perl ./Configure --prefix=/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t --openssldir=/Users/someuser/homebrew/etc/openssl@1.1 no-ssl3 no-ssl3-method no-zlib darwin64-arm64-cc enable-ec_nistp_64_gcc_128 ==> make Last 15 lines from /Users/someuser/Library/Logs/Homebrew/openssl@1.1/02.make: clang -I. -Iinclude -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/someuser/homebrew/etc/openssl@1.1\"" -DENGINESDIR="\"/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG -MMD -MF crypto/rsa/rsa_pk1.d.tmp -MT crypto/rsa/rsa_pk1.o -c -o crypto/rsa/rsa_pk1.o crypto/rsa/rsa_pk1.c clang -I. -Iinclude -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/someuser/homebrew/etc/openssl@1.1\"" -DENGINESDIR="\"/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG -MMD -MF crypto/rsa/rsa_pmeth.d.tmp -MT crypto/rsa/rsa_pmeth.o -c -o crypto/rsa/rsa_pmeth.o crypto/rsa/rsa_pmeth.c clang -I. -Iinclude -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/someuser/homebrew/etc/openssl@1.1\"" -DENGINESDIR="\"/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG -MMD -MF crypto/rsa/rsa_prn.d.tmp -MT crypto/rsa/rsa_prn.o -c -o crypto/rsa/rsa_prn.o crypto/rsa/rsa_prn.c clang -I. -Iinclude -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/someuser/homebrew/etc/openssl@1.1\"" -DENGINESDIR="\"/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG -MMD -MF crypto/rsa/rsa_pss.d.tmp -MT crypto/rsa/rsa_pss.o -c -o crypto/rsa/rsa_pss.o crypto/rsa/rsa_pss.c clang -I. -Iinclude -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/someuser/homebrew/etc/openssl@1.1\"" -DENGINESDIR="\"/Users/someuser/homebrew/Cellar/openssl@1.1/1.1.1t/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG -MMD -MF crypto/rsa/rsa_saos.d.tmp -MT crypto/rsa/rsa_saos.o -c -o crypto/rsa/rsa_saos.o crypto/rsa/rsa_saos.c make[1]: *** [crypto/rsa/rsa_none.o] Killed: 9 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [crypto/rsa/rsa_pmeth.o] Killed: 9 make[1]: *** [crypto/rsa/rsa_lib.o] Killed: 9 make[1]: *** Deleting file `crypto/rsa/rsa_lib.o' make[1]: *** [crypto/rsa/rsa_pss.o] Killed: 9 make[1]: *** [crypto/rsa/rsa_pk1.o] Killed: 9 make[1]: *** Deleting file `crypto/rsa/rsa_pk1.o' /bin/sh: line 1: 66575 Killed: 9 cmp crypto/rsa/rsa_gen.d.tmp crypto/rsa/rsa_gen.d > /dev/null 2> /dev/null make: *** [all] Error 2 Do not report this issue to Homebrew/brew or Homebrew/homebrew-core! These open issues may also help: openssl@1.1: make keg_only on Linux
brew config 信息
HOMEBREW_VERSION: 4.0.3 ORIGIN: https://github.com/Homebrew/brew HEAD: ba6d87eed9ce31f42fa2b33a4e6067d9cf17f13f Last commit: 5 days ago Core tap origin: https://github.com/Homebrew/homebrew-core Core tap HEAD: c199be743a4e2870c855aa8948a1dc16bebb5c12 Core tap last commit: 65 minutes ago Core tap branch: master HOMEBREW_PREFIX: /Users/someuser/homebrew HOMEBREW_REPOSITORY: /Users/someuser/homebrew HOMEBREW_CELLAR: /Users/someuser/homebrew/Cellar HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 12 Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: dodeca-core 64-bit arm_blizzard_avalanche Clang: 14.0.0 build 1400 Git: 2.37.1 => /Library/Developer/CommandLineTools/usr/bin/git Curl: 7.86.0 => /usr/bin/curl macOS: 13.2.1-arm64 CLT: 14.2.0.0.1.1668646533 Xcode: N/A Rosetta 2: false
brew doctor 信息
Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Your Homebrew's prefix is not /opt/homebrew. Many of Homebrew's bottles (binary packages) can only be used with the default prefix. Consider uninstalling Homebrew and reinstalling into the default prefix. It is expected behaviour that some formulae will fail to build in this unsupported configuration. It is expected behaviour that Homebrew will be buggy and slow. Do not create any issues about this on Homebrew's GitHub repositories. Do not create any issues even if you think this message is unrelated. Any opened issues will be immediately closed without response. Do not ask for help from Homebrew or its maintainers on social media. You may ask for help in Homebrew's discussions but are unlikely to receive a response. Try to figure out the problem yourself and submit a fix as a pull request. We will review it but may or may not accept it.
排查与解决
最初推测是Brew非标准安装路径导致编译失败,经过排查后确认问题源于公司设备的用户配置限制,调整配置后已成功完成openssl@1.1的安装。
内容的提问来源于stack exchange,提问作者rodrigo
相关产品推荐
相关产品推荐

