Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 31871 - Obsolete use of "tail -1" in gentoo-sources kernel 2.4.20 Makefile nulls LINUX_COMPILER in include/linux/compile.h, breaking alsa-driver ebuild
Summary: Obsolete use of "tail -1" in gentoo-sources kernel 2.4.20 Makefile nulls LINU...
Status: RESOLVED DUPLICATE of bug 23116
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-23 18:51 UTC by Ed Catmur
Modified: 2005-07-17 13:06 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2003-10-23 18:51:35 UTC
I detected this after tracing an error in the configure stage of the alsa-driver ebuild to the last line of include/linux/compile.h:

    #define LINUX_COMPILER ""

which should be

    #define LINUX_COMPILER "gcc version 3.3.1 20030927 (Gentoo Linux 3.3.1-r5, propolice)"

This should be set in the top-level Makefile, line 351 in 2.4.20-r7:

    @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -1`\" >> .ver

Note the obsolete use of 'tail -1' - on a recently installed system the tail in coreutils will refuse to recognise this syntax, with the result that LINUX_COMPILER is set to "". The line should therefore be amended to:

    @echo \#define LINUX_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> .ver

I have constructed a local ebuild containing a patch for the line in question, and it applies as expected, giving a working kernel and allowing me to emerge alsa-driver without errors.

Comparing against other systems suggests that the change to coreutils is very recent - I have seen a /bin/tail emerged on Sep 28th that accepts the obsolete syntax. My /bin/tail was created Oct 17th. And both coreutils are version 5.0.91!

The problem exists in 2.4.20-r7 and -r8; I haven't looked in earlier versions. However, 2.6-test8 uses the correct syntax; the error was probably corrected when the task of writing include/linux/compile.h was removed from the top-level Makefile into scripts/mkcompile.h.

Possibly this will fix some of the alsa-driver bugs - I filed a new bug instead of finding an alsa-driver bug to append to because the error is in sys-kernel/gentoo-sources rather than in alsa-driver (although the case can be made that the alsa-driver configure script should be able to handle this gracefully; a quick read of the script suggests that it *tries* to handle such conditions gracefully but fails dismally...)

Oh, for aid of searching I reproduce the alsa-driver configure error below:
(...)
checking for GCC version... Kernel compiler:   Used compiler: gcc (GCC) 3.3.1 20030927 (Gentoo Linux 3.3.1-r5, propolice)
Fatal error: Compiler type does not match
Decoded kernel compiler: type= version=
Decoded used compiler: type=gcc version=3.3.1
(...)
Comment 1 Ed Catmur 2003-10-23 18:53:35 UTC
SORRY! for messing up your screen - my first bug for some time; I forgot
that 
bugzilla doesn't wrap at 80 - sorry!
Comment 2 SpanKY gentoo-dev 2003-10-23 22:04:46 UTC

*** This bug has been marked as a duplicate of 29965 ***
Comment 3 Ed Catmur 2003-10-25 17:30:21 UTC
Er... Actually, this is a kernel bug not an alsa bug.
Can't be bothered to email the above (vapier@gentoo.org) so I've appended
to bug 23116 instead (23116#25). Hopefully it'll get fixed either way.
Comment 4 Ed Catmur 2003-10-25 17:31:02 UTC
That's better.

*** This bug has been marked as a duplicate of 23116 ***