天天看点

多个so合并为一个so的思路

  搜索了一下,了解到:

  • 多个.so(动态库)无法合并为一个.so。
  • 多个.a(静态库)可以合并为一个.so。命令是:
gcc -shared -o c.so -Wl,--whole-archive a.a b.a -Wl,--no-whole-archive