Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114923 - ROOT=/some/dir emerge system fails during glibc configuration because os-headers werent merged
Summary: ROOT=/some/dir emerge system fails during glibc configuration because os-head...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 115445 (view as bug list)
Depends on:
Blocks: 119737
  Show dependency tree
 
Reported: 2005-12-08 15:30 UTC by Philippe Troin
Modified: 2006-05-22 23:15 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
glibc-2.3.4.20040808-r1.ebuild.patch (glibc-2.3.4.20040808-r1.ebuild.patch,1.41 KB, patch)
2006-01-25 13:24 UTC, Tobias Scherbaum (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Troin 2005-12-08 15:30:10 UTC
Running "ROOT=/some/dir emerge system" fails with:

checking for i386 TLS support... yes
running configure fragment for sysdeps/pthread
running configure fragment for libidn/sysdeps/unix
running configure fragment for sysdeps/unix/sysv/linux
checking for egrep... (cached) grep -E
checking installed Linux kernel header files... TOO OLD!
configure: error: GNU libc requires kernel header files from
Linux 2.0.10 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 2.0.10 or later.  This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files.  To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.

!!! ERROR: sys-libs/glibc-2.3.5-r2 failed.
!!! Function glibc_do_configure, Line 927, Exitcode 1
!!! failed to configure glibc
!!! If you need support, post the topmost build error, NOT this status message.

---

The wierd thing is that glibc's ebuild (glibc-2.3.5-r2) depends on
virtual/os-headers.  However portage does not emerge linux-headers before
emerging glibc.


Reproducible: Always
Steps to Reproduce:
Comment 1 Philippe Troin 2005-12-08 15:30:40 UTC
emerge --info:

Portage 2.0.51.22-r3 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2,
2.6.14-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.14-gentoo-r2 x86_64 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.6.13
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=opteron -mtune=opteron"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -march=opteron -mtune=opteron"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks notitles sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="C"
LINGUAS="en en_US en_GB fr fr_FR zh zh_CN zh_TW"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X Xaw3d alsa audiofile avi berkdb bitmap-fonts bzip2 cdparanoia cdr
crypt cups dbus doc dvd dvdr dvdread eds emacs emboss encode esd ethereal exif
expat fam firefox flac foomaticdb gd gdbm gif glut gnome gnutls gphoto2 gpm
gstreamer gtk gtk2 hal idn imagemagick imlib jpeg kde lcms leim libwww lzw
lzw-tiff mad mikmod mng mp3 mpeg ncurses nis nls offensive ogg opengl pam pcre
pda pdflib perl png python quicktime readline recode sdl spell ssl tcpd tetex
theora tiff truetype truetype-fonts type1-fonts udev usb userlocales vcd vorbis
xine xml2 xpm xv xvid zlib linguas_en linguas_en_US linguas_en_GB linguas_fr
linguas_fr_FR linguas_zh linguas_zh_CN linguas_zh_TW userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS

Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-12-08 17:07:18 UTC
Are you doing this on a system that does not have a completed installation in "/" ?
Comment 3 Philippe Troin 2005-12-08 17:52:22 UTC
No, my set-up is complete in /.  Notably, linux-headers are installed correctly
in /, and "emerge -1 glibc" (no ROOT set) works correctly.
However, if ROOT is set, then "emerge -1 glibc".
Reproduce with:

  mkdir /tmp/glibc-root
  ROOT=/tmp/glibc-root emerge system

glibc is about the 4th package compiled (and it fails).
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-12-08 23:05:54 UTC
glibc-2.3.5-r2 has the following in RDEPEND and nothing in PDEPEND:
nls? ( sys-devel/gettext ) selinux? ( !build? ( sys-libs/libselinux ) )

Therefore, according to glibc's deps, it doesn't require anything in the runtime
root.
Comment 5 Mike Green 2005-12-15 14:08:13 UTC
I ran into this problem when using catalyst (bug 115445). 
 
It appears that the glibc dependency check looks for linux-headers in the 
running system, but attempts to use the headers in ROOT, which may or may not 
be present in ROOT. 
 
A quick workaround is to ROOT=/wherever emerge -1 linux-headers, then resume 
with glibc... 
Comment 6 Chris Gianelloni (RETIRED) gentoo-dev 2005-12-16 08:25:50 UTC
*** Bug 115445 has been marked as a duplicate of this bug. ***
Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2005-12-16 08:27:13 UTC
This is currently stopping release building, so I am upgrading it to a blocker,
as we are nearing release time.
Comment 8 SpanKY gentoo-dev 2005-12-16 16:46:31 UTC
fixed in cvs
Comment 9 Brent Baude (RETIRED) gentoo-dev 2005-12-17 11:28:44 UTC
hey Spanky, I'll look for you on irc but what did you fix? I updated my snapshot this morning and still have the same problem.
Comment 10 SpanKY gentoo-dev 2005-12-17 17:21:25 UTC
wolf and gustavoz verified the fix on amd64/sparc
Comment 11 Brent Baude (RETIRED) gentoo-dev 2005-12-17 17:46:36 UTC
Spanky, it is still failing on ppc64.  Linux headers is the last package to be emerged for stage1.  What was the fix?  Maybe I can poke at it too...
Comment 12 Chris Gianelloni (RETIRED) gentoo-dev 2005-12-19 04:32:07 UTC
This was the fix in the stable glibc ebuild.  Perhaps your stable version is just older?  It works on glibc-2.3.5-r2 (and -r3).

@@ -958,6 +959,9 @@ glibc_do_configure() {
                myconf="${myconf} --without-selinux"
        fi

+       # Pick out the correct location for build headers
+       local headersloc=$(alt_headers)
+       tc-is-cross-compiler && headersloc=${ROOT}${headersloc}
        myconf="${myconf}
                --without-cvs
                --enable-bind-now
@@ -965,7 +969,7 @@ glibc_do_configure() {
                --host=${CTARGET_OPT:-${CTARGET}}
                $(use_enable profile)
                --without-gd
-               --with-headers=${ROOT}$(alt_headers)
+               --with-headers=${headersloc}
                --prefix=$(alt_prefix)
                --mandir=$(alt_prefix)/share/man
                --infodir=$(alt_prefix)/share/info
Comment 13 gent_bz 2005-12-22 05:20:29 UTC
I'm seeing a problem with ~x86 and unmasked >=glibc-2.3.6, but this would appear to still effect all versions of glibc in portage.

It appears that the problem is related to the check for sufficiently high level linux-headers to satisfy nptl.

A change to check_kheader_version() as done in  glibc_do_configure() (and toolchain-glibc_headers_compile()) should do the trick.  e.g. something like :

# pseudo diff
 check_kheader_version() {
+    # Pick out the correct location for build headers
+    local headersloc=$(alt_headers)
+    tc-is-cross-compiler && headersloc=${ROOT}${headersloc}

-    local header="${ROOT}$(alt_headers)/linux/version.h"
+    local header="${headersloc}/linux/version.h"


It's probably (almost) worth factoring this out into another function...

Anyway, the above seems to work here.
Comment 14 Tobias Scherbaum (RETIRED) gentoo-dev 2006-01-10 07:58:44 UTC
Can we get this fix backported to the latest stable glibc (glibc-2.3.4.20040808-r1)on hppa?
Comment 15 Mike Green 2006-01-10 08:05:42 UTC
> A change to check_kheader_version() as done in  glibc_do_configure() (and
> toolchain-glibc_headers_compile()) should do the trick.  e.g. something like :

Which set of headers will this compile glibc against?  The headers in /, or in ROOT?
Comment 16 SpanKY gentoo-dev 2006-01-10 17:04:05 UTC
added to older crusty ebuilds
Comment 17 Lars Weiler (RETIRED) gentoo-dev 2006-01-16 15:21:26 UTC
(In reply to comment #13)
> It appears that the problem is related to the check for sufficiently high level
> linux-headers to satisfy nptl.

That's the reason why catalyst stopped for me.  nptl is enabled and check_kheader_version set header=/tmp/stage1root//usr/include/linux/version.h, which doesn't exit in the destination dir, although ALT_HEADERS=/usr/include is set.

This fix should also go into the ebuild.  Testing with an overlay now.
Comment 18 Lars Weiler (RETIRED) gentoo-dev 2006-01-21 10:50:47 UTC
That blocks the ppc-release, as we do stage1 with nptl.
Comment 19 Chris Gianelloni (RETIRED) gentoo-dev 2006-01-21 14:46:01 UTC
Well, my current suggestion would be to switch from having stage1 built with nptl, since this needs to be resolved and it should not hold up the release.
Comment 20 SpanKY gentoo-dev 2006-01-23 16:40:51 UTC
fixed in all 2.3.5 and 2.3.6 ebuilds
Comment 21 Tobias Scherbaum (RETIRED) gentoo-dev 2006-01-25 13:24:04 UTC
Created attachment 78100 [details, diff]
glibc-2.3.4.20040808-r1.ebuild.patch

(In reply to comment #16)
> added to older crusty ebuilds
> 

Please apply the patch, the latest in-cvs version still searchs for includes in /tmp/stage1root/usr/include.
Comment 22 Tobias Scherbaum (RETIRED) gentoo-dev 2006-01-25 13:24:26 UTC
And once again reopened.
Comment 23 SpanKY gentoo-dev 2006-01-25 18:16:29 UTC
(In reply to comment #21)
> Created an attachment (id=78100) [edit]
> glibc-2.3.4.20040808-r1.ebuild.patch
> 
> Please apply the patch, the latest in-cvs version still searchs for includes in
> /tmp/stage1root/usr/include.

what you meant was the latest outdated version of glibc in-cvs is still broken

back ported to the crappy versions
Comment 24 Tobias Scherbaum (RETIRED) gentoo-dev 2006-02-01 08:32:58 UTC
I'm still having an issue with this on HPPA while building a stage1. For the first glibc-build the headers are taken from /usr/include (which works), for the second glibc-build headers are included from /tmp/stage1root/usr/include (which doesn't work).

I tested with both CVS revisions containing "the fixed" glibc-2.3.4.20040808-r1.ebuild (cvs rev 1.52 and 1.53), both failing ...
Comment 25 Joe Jezak (RETIRED) gentoo-dev 2006-02-17 09:35:37 UTC
This is working for the ppc stable glibc builds, so removing ppc from the CC list.
Comment 26 Chris Gianelloni (RETIRED) gentoo-dev 2006-03-17 06:15:36 UTC
Tobias:  Is this RESOLVED now?
Comment 27 SpanKY gentoo-dev 2006-04-20 20:30:17 UTC
2.4-r2 works for sure
Comment 28 SpanKY gentoo-dev 2006-05-22 23:15:26 UTC
*** Bug 133607 has been marked as a duplicate of this bug. ***