简体   繁体   中英

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.

on srs branch: 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?

There is an issue 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 .

However, we will adapt ST to M1 in future, for building and debugging from source code.

Aside from openssl build issue, we also need to adapt the ST(state-threads) for Apple M1. Apart from the ST(state-threads) adaption, the configure script would need to be update to identify M1. Grossly simplified, Apple M1 does not work definitely right now.

But as the widely use for new Mac Book, it gains importance to adapt SRS/ST for M1. 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. It's possible to run SRS on all these CPU arch, they are not mutually exclusive. Adaption for ST(states-threads) is used to be awkward work, but now it's very easy with some tools, see #22 .

Ultimately, it's worth to, and we will fix it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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