Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36190 - coreutils uname fix for hppa, ppc and alpha
Summary: coreutils uname fix for hppa, ppc and alpha
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-20 10:28 UTC by Guy Martin (RETIRED)
Modified: 2004-05-17 20:25 UTC (History)
2 users (show)

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


Attachments
Correct ppc behaviour of uname and add hppa code. (uname-pi-fix-hppa-ppc.diff,543 bytes, patch)
2003-12-20 10:30 UTC, Guy Martin (RETIRED)
Details | Diff
Fix uname for hppa, ppc and alpha (uname-pi-hppa-ppc-alpha.patch,677 bytes, patch)
2003-12-27 12:53 UTC, Guy Martin (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Martin (RETIRED) gentoo-dev 2003-12-20 10:28:52 UTC
uname in the latest coreutils is broken for at least ppc and hppa.
The cause of this b0rkage is 003_all_coreutils-gentoo-uname.patch.

This patch does not contains code for hppa and the ppc section of this patch is broken.

On ppc "uname -p" returns "0" which is the processor number first readed in /proc/cpuinfo. And "uname -i" returns the cpu type which is wrong.

The patch I will attach in a few correct the ppc behaviour and add the correct hppa code. It should be applied after the actual patches are applied.

This patch was tested succefully on both g3, g4, hppa1.1 and hppa2.0.
Comment 1 Guy Martin (RETIRED) gentoo-dev 2003-12-20 10:30:03 UTC
Created attachment 22486 [details, diff]
Correct ppc behaviour of uname and add hppa code.
Comment 2 Guy Martin (RETIRED) gentoo-dev 2003-12-20 10:34:32 UTC
I should also add that looking at the code reveal that the 003_all_coreutils-gentoo-uname.patch might be broken for others arch.
In particular, alpha boxes have a broken uname -i which return nothing.
Comment 3 Joshua Kinard gentoo-dev 2003-12-22 22:31:36 UTC
This had to be fixed for mips once.  The patch instructs uname to grab data from /proc/cpuinfo, and for mips, it was grabbing the "processor" field, which also returned 0.

Rather than apply this patch after the first, might be better to edit the existing patch (which was done for mips.

Any alpha people got info on what uname -i should be returning?
Comment 4 Guy Martin (RETIRED) gentoo-dev 2003-12-25 12:36:36 UTC
                                #if defined(__mips__)
                                        "cpu model", "system type"
                                #endif

That's the code for mips.
I checked with tuxus and it seemed to return the right output.

Kumba, can you check this again plz ?
Comment 5 Joshua Kinard gentoo-dev 2003-12-25 14:36:19 UTC
That is correct for mips.  It used to be "processor, system type" for mips, and it had to be changed to cpu model instead.
Comment 6 Guy Martin (RETIRED) gentoo-dev 2003-12-27 12:53:41 UTC
Created attachment 22717 [details, diff]
Fix uname for hppa, ppc and alpha

I've check with alpha and sparc ppl and only alpha needed a fix. sparc is
correct and others arch should be too.
Comment 7 Seemant Kulleen (RETIRED) gentoo-dev 2003-12-27 14:09:04 UTC
fixed in portage. Thanks Guy :)
Comment 8 Kolbjørn Barmen 2004-04-29 22:45:00 UTC
This patch for all the officially supported architectures leaves uname segfaulting on -a/-i/-p when compiled on anything else - not good.
Comment 9 Aron Griffis (RETIRED) gentoo-dev 2004-04-30 11:08:47 UTC
Kolbj
Comment 10 Aron Griffis (RETIRED) gentoo-dev 2004-04-30 11:08:47 UTC
Kolbjørn, could you explain please what you mean?
Comment 11 SpanKY gentoo-dev 2004-05-01 23:20:19 UTC
yeah, you cant sit there and say something crashes Kolbj
Comment 12 SpanKY gentoo-dev 2004-05-01 23:20:19 UTC
yeah, you cant sit there and say something crashes Kolbjørn when you dont provide any information

uname -a/i/p works fine on my x86/hppa/ppc/arm
Comment 13 Kolbjørn Barmen 2004-05-03 00:15:04 UTC
Line 138-196 of uname.c

The '*sdata[] = {}' part does not contain any escape for non listed platforms, gived that USE_PROCINFO is defined. For this means that uname segfaults on m68k.
Comment 14 SpanKY gentoo-dev 2004-05-17 19:16:21 UTC
ok, i didnt realize that the procinfo support isnt from upstream in the first place ... i'll update the code so it'll work on any arch (and add some more code for ARM :D)
Comment 15 SpanKY gentoo-dev 2004-05-17 20:25:51 UTC
coreutils-5.2.1 has this fixed ...

i integrated the s390 patch (dont know why they didnt :P), added a case for arm, and added a default case for other architectures ...

coreutils-5.2.1-gentoo-0.3.tar.bz2 has these changes ... no rev bump because installed base shouldnt be any different