Search code examples
c++gccstatic-linkingabigcc7

libstdc++ static linking & System V ABI


When I compile with -static-libstdc++, compiled binary uses UNIX - GNU ABI, but I need to get a binary with UNIX - System V ABI. (I need a compatibility with FreeBSD) I also tried Compile libstdc++ with hash style SYSV, but it doesn't help.

$ gcc-7.1 -v
Using built-in specs.
COLLECT_GCC=gcc-7.1
COLLECT_LTO_WRAPPER=/usr/local/gcc-7.1/libexec/gcc/x86_64-linux-gnu/7.1.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../gcc-7.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-7.1 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-7.1 : (reconfigured) ../gcc-7.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-7.1 --enable-checking=release --enable-languages=c,c++,fortran --program-suffix=-7.1 : (reconfigured) ../gcc-7.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-7.1 --enable-checking=release --enable-languages=c,c++,fortran --program-suffix=-7.1 --disable-gnu-unique-object
Thread model: posix
gcc version 7.1.0 (GCC)

Solution

  • So, the problem was solved when I fully recompiled gcc instead of reconfiguring.