[cfe-dev] -O2 requires GLIBCXX_3.4.9?

Nikos Chantziaras realnc at gmail.com
Thu Sep 13 04:03:05 PDT 2012

On 13/09/12 11:48, Mohamed Bana wrote:
> Hi All,
> Why does compiling with -O2 force the resulting binary to require GLIBCXX_3.4.9?
> I need to run my binaries on this machine and when I compile with -O0 it seems
> to work fine.
> $ uname -a
> Linux itrsrh.ldn.itrs 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:56 EDT 2011
> i686 i686 i386 GNU/Linux
> $ lsb_release -a
> LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-
> noarch:printing-4.0-ia32:printing-4.0-noarch
> Distributor ID: CentOS
> Description:    CentOS release 5.6 (Final)
> Release:        5.6
> Codename:       Final

Because -O2 enables certain compiler options that require a certain 
glibc version.

glibc is generally not backwards compatible.  You cannot build on a new 
version and have a guarantee that it runs on older ones.  If you want 
that, you should build against an older glibc.

More information about the cfe-dev mailing list