5

I want to compile a program and statically link it to glibc, so it can run on other Linux distributions without the user having to do any special configuration.

I tried using CFLAGS="-static -static-libgcc", but it statically links against all other libraries required, except glibc. I tried searching the apt repositories for a static version of glibc, but I couldn't find any.

How can I get a static library version of glibc on Ubuntu 18.04?

More information:

  • The project is using autotools
  • I am using the default gcc preinstalled with Ubuntu
  • I set CFLAGS with export CFLAGS="-static -static-libgcc"
  • I am compiling the project with cd tsschecker && ./autogen.sh && make
  • Link to project(if you want to clone the project, make sure to use git clone --recurse-submodules)
airsquared
  • 151
  • 1
  • 5

0 Answers0