简体   繁体   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

Operation on 'Mac M1 pro' which cpu is arm64 architecture.在 CPU 为 arm64 架构的“Mac M1 pro”上运行。

on srs branch: 4.0release在 srs 分支上: 4.0release

do

cd trunk
./configure --osx 

Get error as below:得到如下错误:

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.

Log is:日志是:

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.

What's the possible reason for this error?这个错误的可能原因是什么? Is there any way to avoid it?有什么办法可以避免吗?

It seems the gcc config param '-arch i386' is not right for my environment, is it the root cause of this error?似乎 gcc 配置参数 '-arch i386' 不适合我的环境,这是此错误的根本原因吗?

There is an issue M1: Not possible to build on Apple Silicon .有一个问题M1: Not possible to build on Apple Silicon

We have the docker images for linux/arm/v7 and linux/arm64/v8 , it should work on Apple M1 also, see #3058 .我们有linux/arm/v7linux/arm64/v8的 docker 镜像,它应该也可以在Apple M1上运行,参见#3058

However, we will adapt ST to M1 in future, for building and debugging from source code.但是,我们将来会将 ST 适配到 M1,以便从源代码构建和调试。

Aside from openssl build issue, we also need to adapt the ST(state-threads) for Apple M1.除了 openssl 构建问题,我们还需要为 Apple M1 调整 ST(状态线程)。 Apart from the ST(state-threads) adaption, the configure script would need to be update to identify M1.除了 ST(状态线程)适配之外,配置脚本还需要更新以识别 M1。 Grossly simplified, Apple M1 does not work definitely right now.粗略简化,Apple M1 现在肯定不能正常工作。

But as the widely use for new Mac Book, it gains importance to adapt SRS/ST for M1.但随着新 Mac Book 的广泛使用,为 M1 适配 SRS/ST 变得越来越重要。 So the only proper way, is to wait for us to fix it, to avoiding any corruptions.所以唯一正确的方法是等待我们修复它,以避免任何损坏。 We will also do some test to ensure test cases for different realm could run successfully.我们还将做一些测试,以确保不同领域的测试用例能够成功运行。

While M1 is ARM arch, which is a separated phenomenon from Intel x86 arch and linux arm/aarch which already works.而 M1 是 ARM 架构,这是与英特尔 x86 架构和已经工作的 linux arm/aarch 分开的现象。 It's possible to run SRS on all these CPU arch, they are not mutually exclusive.可以在所有这些 CPU 架构上运行 SRS,它们不是互斥的。 Adaption for ST(states-threads) is used to be awkward work, but now it's very easy with some tools, see #22 .过去对 ST(states-threads) 的适应是一件很尴尬的工作,但现在使用一些工具很容易,参见#22

Ultimately, it's worth to, and we will fix it.最终,这是值得的,我们会修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM