how to compile a lower gcc/glibc version compatible binary?

Florian Weimer fw@deneb.enyo.de
Tue Dec 29 12:25:00 GMT 2015


* Derek Ch:

> the workaround is to use a lower debian version (same as the target)
> as the development system, but what if I want the better generated
> code by gcc-5.2 ?

Then you have to compile GCC on your own.  This may need changes to
GCC to avoid dependencies on newer libgcc versions in generated
executables.  More changes may be needed if you need C++ support.

> So does gcc support such requirement to build a binary without
> linking symbols higher than a specific lib version?

This is predominantly a library issue.  For glibc, there are no plans
to support targeting older glibc versions from newer glibc build
environments.

Beyond glibc, few libraries pay careful attention to backwards
compatibility, so it is generally recommended to recompile
applications with the distribution toolchain and ship multiple builds,
one for each distribution.

Florian



More information about the Gcc-help mailing list