Search code examples
gccstaticlinkerlibtool

How to statically compile gerbv for Heroku


I'm trying to compile gerbv 2.6 so that I can include it in my Heroku bin directory, but I can't seem to figure it out. I've tried various combinations of:

CFLAGS='-static  -static-libgcc  -static-libstdc++' ./configure
./configure --enable-static
./configure --enable-static=yes --enable-shared=no

But after running make I always get:

src/gerbv: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x401fe83e54660a42e80e4c529fde85799728cdcb, not stripped

I'm running out of ideas. Anyone have any?


Solution

  • This is most likely because the system libraries, or the gcc runtime is linked shared. Use the "ldd" utility to see what is being dynamically linked.

    ldd src/gerbv

    A shared runtime is probably what you want, but if you want the runtimes to be static, there may be an option for that if you have a static runtime installed.