This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how to compile a lower gcc/glibc version compatible binary?
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Derek Ch <rcheng881 at student dot glendale dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 29 Dec 2015 13:25:36 +0100
- Subject: Re: how to compile a lower gcc/glibc version compatible binary?
- Authentication-results: sourceware.org; auth=none
- References: <20151229110722 dot GA29384 at ubuntu-gnome>
* 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