簡體   English   中英

Mac pro m1(arm64 cpu)中的 SRS 配置錯誤 - ld:未找到架構 i386 的符號

[英]SRS configure error in Mac pro m1 (arm64 cpu)- ld: symbol(s) not found for architecture i386

在 CPU 為 arm64 架構的“Mac M1 pro”上運行。

在 srs 分支上: 4.0release

cd trunk
./configure --osx 

得到如下錯誤:

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [apps/openssl] Error 1
make: *** [all] Error 2
Build openssl-1.1-fit failed.

日志是:

User config: --osx
Detail config: --prefix=/usr/local/srs --config=conf/srs.conf --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-caster=on --http-api=on --utest=off --cherrypy=off --srt=off --rtc=on --simulator=off --cxx11=off --cxx14=off --ffmpeg-fit=on --nasm=on --srtp-nasm=on --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=off --shared-ffmpeg=off --log-verbose=off --log-info=off --log-trace=on --gcov=off --debug=off --debug-stats=off --cross-build=off --cc=gcc --cxx=g++ --ar=ar --ld=gcc --randlib=randlib
SRS_WORKDIR: ., SRS_OBJS_DIR: objs, SRS_OBJS: ./objs, SRS_PLATFORM: Platform-Darwin-21.2.0-Clang13.1.6-SRS4-arm64
Alias python2 as python
Checking gcc/g++/gdb/make.
Required tools are ok.
OSX detected, install tools if needed
OSX install tools success
SED is sed_utility
The state-threads is ok.
Building openssl-1.1-fit.
Operating system: i686-apple-darwinDarwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000
Configuring OpenSSL version 1.1.1b (0x1010102fL) for darwin-i386-cc
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

...
gcc  -I. -Iinclude -fPIC -arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/Users/hangwu/git/srs/trunk/objs/Platform-Darwin-21.2.0-Clang13.1.6-SRS4-arm64/openssl-1.1-fit/_release/ssl\"" -DENGINESDIR="\"/Users/hangwu/git/srs/trunk/objs/Platform-Darwin-21.2.0-Clang13.1.6-SRS4-arm64/openssl-1.1-fit/_release/lib/engines-1.1\"" -DNDEBUG -DOPENSSL_NO_HEARTBEATS -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c

...



ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [apps/openssl] Error 1
make: *** [all] Error 2
Build openssl-1.1-fit failed.

這個錯誤的可能原因是什么? 有什么辦法可以避免嗎?

似乎 gcc 配置參數 '-arch i386' 不適合我的環境,這是此錯誤的根本原因嗎?

有一個問題M1: Not possible to build on Apple Silicon

我們有linux/arm/v7linux/arm64/v8的 docker 鏡像,它應該也可以在Apple M1上運行,參見#3058

但是,我們將來會將 ST 適配到 M1,以便從源代碼構建和調試。

除了 openssl 構建問題,我們還需要為 Apple M1 調整 ST(狀態線程)。 除了 ST(狀態線程)適配之外,配置腳本還需要更新以識別 M1。 粗略簡化,Apple M1 現在肯定不能正常工作。

但隨着新 Mac Book 的廣泛使用,為 M1 適配 SRS/ST 變得越來越重要。 所以唯一正確的方法是等待我們修復它,以避免任何損壞。 我們還將做一些測試,以確保不同領域的測試用例能夠成功運行。

而 M1 是 ARM 架構,這是與英特爾 x86 架構和已經工作的 linux arm/aarch 分開的現象。 可以在所有這些 CPU 架構上運行 SRS,它們不是互斥的。 過去對 ST(states-threads) 的適應是一件很尷尬的工作,但現在使用一些工具很容易,參見#22

最終,這是值得的,我們會修復它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM