I got symbol collision problems when compiling IOS APP.
I have already read solutions like changing names, using libtool(ld).
And I have tried several schemes:
- Use the command
ld -arch arm64 -r libMyOrig.a -o libMyNew.a -alias_list symbols_old_new.dat
The file symbols_old_new.dat is just like: _funcA1 _NewName_funcA1
_funcA2 _NewName_funcA2
_funcA3 _NewName_funcA3
Checking libMyNew.a with command "nm -nm libMyNew.a", I found _funcA1 _funcA2 _funcA3 were become none-external symbols and _NewName_funcA1 _NewName_funcA2 _NewName_funcA3 were external symbols.
After these steps, I can successfully build my app, but it got crashed when running. Maybe making symbols none-external is not good enough. - Compile LLVM(objcopy x86_64) on MacOS
Use command objcopy --redefine-syms symbols_old_new.dat libMyOrig.a -o libMyNew.a
When compiling app I got warning massage like "unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x5F 0x5F 0x2E 0x53 0x59 0x4D 0x44 0x45 )"
I thought maybe I shouldn't use the x86_64-objcopy. So I cross-compiled an ARM64-LLVM.
Sadly, my MacOS is x86_64 and I don't know how to run the command ARM64-LLVM-objcopy.
I'm stuck here.
Does anyone know a clever way to make this right? Thanks.