Matthew Burgess wrote:
> On Wed, 21 Aug 2013 21:20:43 +0800, JC Chong <jayceech...@gmail.com>
> wrote:
>> Another thing, the HSR lists a minimum running 2.6.25 kernel, but 
>> building glibc 2.18 needs --enable-kernel=2.6.34. A long time ago, 
>> during the LFS 5.1 days, I tried --enable-kernel=2.6.0 with a
>> running 2.4.x kernel and I got all sorts of errors midway.
> 
> I can see how going from 2.4 -> 2.6 would cause issues.  2.6.x to
> 2.6.y shouldn't be too much of an issue.

It actually depends on what you're trying to do.  :-)

See sysdeps/unix/sysv/linux/kernel-features.h in the glibc source tree
for the full list, but for example, accept4() got added in 2.6.28.
(Which adds flags to the syscall so that you can set O_NONBLOCK or
O_CLOEXEC on the socket that accept() returns, without racing.)  So
--enable-kernel=2.6.25 would build compatibility code for when that
version doesn't exist (probably exposing the race, but not returning an
error at least), but 2.6.34 would not (it would probably yield ENOSYS).

But getcpu(), whatever that actually does, showed up in 3.1, so either
of these --enable-kernel values would build in the compat support for
kernels where it doesn't exist.

> The requirement for 2.6.25 is a runtime and buildtime one; udev
> requires some features only present since 2.6.25.  The 2.6.34
> requirement is a build-time one, such that Glibc doesn't include
> fallbacks for features present in that version of the kernel (I think
> I've got that right, but I think I got taken to task by Bryan last 
> time this discussion came up for not getting it right!).

That's pretty close.  The configure flag definitely removes fallbacks
for missing features.

But it's a little complicated, because if you try to exec() a binary
that links to a libc that was configured with --enable-kernel=<newer
than the current kernel>, then I'm pretty sure that libc aborts.
(Because the workarounds are not present.)  So if the host is running
2.6.28 or something, then entering the chroot probably isn't going to
work when chapter 5's libc was built with --enable-kernel=2.6.34.

Which I think does mean that the host requirements are now 2.6.34,
actually.  Unfortunately I don't have a pre-2.6.34 kernel to test with,
so I'm not 100% sure.  (Testing would be building a chapter 5 and seeing
if chroot works, or if env errors out on you.)

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to