Use both static and dynamically linked libraries in gcc

后端 未结 3 2074
时光说笑
时光说笑 2020-11-27 11:09

I need to distribute a binary that will run on as many x86 Linux distributions as possible. That means that I have to statically link some libraries, like glibc, because the

3条回答
  •  悲哀的现实
    2020-11-27 11:22

    It should be noted that, under Linux, you can only (safely) statically link a library if none of the dynamic libraries depend on it. This means that if you're using any dynamic libraries at all, you can forget about statically linking libc. Just use a fairly old version to build against for libc's case; libc has maintained strong ABI backwards-compatiblity over the years.

提交回复
热议问题