This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Building for older systems
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Michael Eager <eager at eagerm dot com>, libc-help at sourceware dot org
- Date: Tue, 1 Dec 2015 13:05:38 -0500
- Subject: Re: Building for older systems
- Authentication-results: sourceware.org; auth=none
- References: <565B0993 dot 7040202 at eagerm dot com> <565B1383 dot 90104 at redhat dot com> <565DB51B dot 9010508 at eagerm dot com> <565DB5DA dot 9090107 at redhat dot com> <565DB8A1 dot 3060901 at eagerm dot com>
On 12/01/2015 10:11 AM, Michael Eager wrote:
> On 12/01/2015 06:59 AM, Carlos O'Donell wrote:
>> On 12/01/2015 09:56 AM, Michael Eager wrote:
>>> On 11/29/2015 07:02 AM, Carlos O'Donell wrote:
>>>> On 11/29/2015 09:20 AM, Michael Eager wrote:
>>>>> Any solutions to building for an older glibc?
>>>>
>>>> There is only one supported way to do what you want.
>>>>
>>>> You need to build against an old sysroot e.g. --sysroot option
>>>> in gcc. With the old system root installed in some path to allow
>>>> you to compile against it.
>>>>
>>>
>>> That is equivalent to building on a VM running an older Linux,
>>> which is what I have been doing.
>>>
>>> There are dependencies in current tool chains for packages
>>> (or versions) which are not available on old (or, in the case
>>> of RH6.2, ancient) versions of Linux.
>>
>> How does this matter to you? The tools can have arbitrary dependencies,
>> but it's the dependencies of the generated code that matters.
>
> It matters that I'm not able to build a current tool chain on
> an old system without installing a large number of new packages.
> And these have other dependencies.
Agreed. You are effectively become a distribution maintainer. We have
teams of people at Red Hat to maintain such a process for Fedora and
RHEL.
>> As always, the compiler injects dependencies into the generated code
>> at times and thus you must have a compatible compiler runtime also
>> on the old legacy system.
>>
>> In practice you almost always need to build a toolchain of the same
>> vintage as your legacy system and use that for cross-compiling to the
>> target legacy system using a sysroot.
>>
>> All in all it's about the equivalent of VM, but in a cross-compilation
>> environment. Any shortcuts you take will eventually come back to bite
>> you.
>
> I'll look at using sysroot. It might address the build dependency
> issues.
The sysroot won't solve your build dependency. Your compiler and tools
will continue to require whatever you have. A sysroot limits the ABI of
the target application to that of the ABI in the sysroot.
Cheers,
Carlos.