Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 142339 - linux kernel powerpc has braindead `uname -m` code
Summary: linux kernel powerpc has braindead `uname -m` code
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: PPC Porters
: 145261 (view as bug list)
Depends on:
Reported: 2006-07-31 14:45 UTC by Nick Pollitt
Modified: 2006-09-03 18:43 UTC (History)
5 users (show)

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

crossdev info log (cross-powerpc-hardhat-linux-gnu-info.log,4.05 KB, text/plain)
2006-07-31 14:47 UTC, Nick Pollitt
crossdev linux-headers log (cross-powerpc-hardhat-linux-gnu-linux-headers.log,66.35 KB, text/plain)
2006-07-31 14:47 UTC, Nick Pollitt
first try (linux-powerpc-defconfigs.patch,558 bytes, patch)
2006-08-05 05:57 UTC, Luca Barbato
Details | Diff
linux-ppc-defconfig.patch (linux-ppc-defconfig.patch,492 bytes, patch)
2006-08-05 11:27 UTC, SpanKY
Details | Diff
Yet another solution (linux-headers-ppc-defconfig.patch,693 bytes, patch)
2006-08-21 02:19 UTC, Luca Barbato
Details | Diff
ebuild fix (linux-headers-ppc-defconfig.patch,695 bytes, patch)
2006-08-21 02:39 UTC, Luca Barbato
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Pollitt 2006-07-31 14:45:49 UTC
Portage 2.1-r1 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, i686)
System uname: i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.6.15
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  0.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
CFLAGS="-O3 -march=pentium4 -msse -msse2 -mmmx "
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O3 -march=pentium4 -msse -msse2 -mmmx "
FEATURES="autoconfig cvs distlocks metadata-transfer sandbox sfperms strict"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
USE="x86 X aac aalib acl acpi aim alsa apache2 apm asf avi bash-completion berkdb bitmap-fonts browserplugin bzip2 bzlib cairo calendar canna cdparanoia cdr cli cpudetection crypt cscope cups custom-cflags dga dio directfb divx4linux dlloader dmx dri dv dvd dvdr dvdread eds emboss encode ethereal fbcon ffmpeg flac flash font-server foomaticdb fortran ftp gcj gd gdbm ggi gif gphoto2 gpm gps gstreamer gtk2 i8x0 ieee1394 imagemagick imap imlib innodb ipv6 isdnlog java jpeg kde kdepim lcms ldap libg++ libwww logitech-mouse mad md5sum mikmod ming mjpeg mmap mmx mng motif mp3 mpeg mplayer mysql ncurses nis nls nodrm nptl nsplugin ogg oggvorbis on-the-fly-crypt opengl pam pcre pda pdflib perl php png posix povray pppd python qt qt3 qt4 quicktime readline real reflection rtc samba sdl session snmp spell spl sse sse2 ssl swat syslog tcltk tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb v4l v4l2 vcd vidix vorbis wifi win32codecs wmf xinerama xml xmms xorg xv xvid xvmc zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU video_cards_i810 video_cards_i865"

Using: "crossdev -v --target ppc-hardhat-linux-gnu"
>>> Emerging (1 of 1) cross-powerpc-hardhat-linux-gnu/linux-headers-2.6.16 to /
>>> checking ebuild checksums ;-)
>>> checking auxfile checksums ;-)
>>> checking miscfile checksums ;-)
>>> checking linux-2.6.16.tar.bz2 ;-)
>>> checking linux-2.6.11-m68k-headers.patch.bz2 ;-)
>>> checking gentoo-headers-2.6.16-3.tar.bz2 ;-)
>>> Unpacking source...
>>> Unpacking linux-2.6.16.tar.bz2 to /var/tmp/cross/powerpc-hardhat-linux-gnu/portage/linux-headers-2.6.16/work
 * gentoo-headers-2.6.16-3.tar.bz2 unpacked
 * Applying 2.6.0-fb.patch (-p0+) ...                                     [ ok ]
 * Applying 2.6.0-sysctl_h-compat.patch (-p0+) ...                        [ ok ]
 * Applying 2.6.10-generic-arm-prepare.patch (-p0+) ...                   [ ok ]
 * Applying 2.6.16-appCompat.patch (-p0+) ...                             [ ok ]
 * Applying 2.6.16-compat_alloc_user_space._k_ify.patch (-p0+) ...        [ ok ]
 * Applying 2.6.16-ia64-fix-ptrace.patch (-p0+) ...                       [ ok ]
 * Applying 2.6.16-powerpc-pte_t.patch (-p0+) ...                         [ ok ]
 * Applying 2.6.16-ppc-memory.patch (-p0+) ...                            [ ok ]
 * Applying 2.6.16-ppc-timex.patch (-p0+) ...                             [ ok ]
 * Applying 2.6.16-ppc64-mc_types.patch (-p0+) ...                        [ ok ]
 * Applying 2.6.16-rtc-includes.patch (-p0+) ...                          [ ok ]
 * Applying 2.6.16-xfsprogs-swab-collision.patch (-p0+) ...               [ ok ]
 * Applying (-p0+) ...                      [ ok ]
 * make defconfig failed.
 * assuming you dont have any headers installed yet and continuing
  CHK     include/linux/version.h
  UPD     include/linux/version.h
 * Applying automated fixes:
 asm-alpha/ asm-arm/ asm-arm26/ asm-cris/ asm-frv/ asm-generic/ asm-h8300/ asm-i386/ asm-ia64/ asm-m32r/ asm-m68k/ asm-m68knommu/ asm-mips/ asm-parisc/ asm-powerpc/ asm-ppc/ asm-s390/ asm-sh/ asm-sh64/ asm-sparc/ asm-sparc64/ asm-um/ asm-v850/ asm-x86_64/ asm-xtensa/ linux/
 * ... done
>>> Source unpacked.
>>> Compiling source in /var/tmp/cross/powerpc-hardhat-linux-gnu/portage/linux-headers-2.6.16/work/linux-2.6.16 ...
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/split-include
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/
  HOSTLD  scripts/kconfig/conf
COPYING CREDITS Documentation Kbuild MAINTAINERS Makefile README REPORTING-BUGS arch block crypto drivers fs include init ipc kernel lib linux-2.6.16 mm net scripts security sound usr Default configuration is based on i686_defconfig
*** Can't find default configuration "arch/powerpc/configs/i686_defconfig"!
make[1]: *** [defconfig] Error 1
make: *** [defconfig] Error 2

!!! ERROR: cross-powerpc-hardhat-linux-gnu/linux-headers-2.6.16 failed.
Call stack:, line 1539:   Called dyn_compile, line 939:   Called src_compile, line 1248:   Called kernel-2_src_compile
  kernel-2.eclass, line 1007:   Called compile_headers
  kernel-2.eclass, line 444:   Called die

!!! defconfig failed (defconfig)
!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! This ebuild is from an overlay: '/usr/local/portage'

 * linux-headers failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-powerpc-hardhat-linux-gnu-info.log
 * /var/log/portage/cross-powerpc-hardhat-linux-gnu-linux-headers.log

I will attach the logfiles next.
Comment 1 Nick Pollitt 2006-07-31 14:47:27 UTC
Created attachment 93149 [details]
crossdev info log
Comment 2 Nick Pollitt 2006-07-31 14:47:58 UTC
Created attachment 93150 [details]
crossdev linux-headers log
Comment 3 SpanKY gentoo-dev 2006-08-04 21:48:59 UTC
this is because the new ppc code in the kernel is just plain stupid

KBUILD_DEFCONFIG := $(shell uname -m)_defconfig

i'll let the ppc team figure out how they wish to deretardize this

my guess, instead of the ugly cp defconfig hack you have now in the linux-headers, you patch the makefile to see if the defconfig exists and if it doesnt, have it fall back to a sane defconfig file
Comment 4 Luca Barbato gentoo-dev 2006-08-05 03:20:30 UTC
The makefile or the eclass...
Comment 5 Luca Barbato gentoo-dev 2006-08-05 05:57:58 UTC
Created attachment 93500 [details, diff]
first try

First try, untested
Comment 6 SpanKY gentoo-dev 2006-08-05 11:27:06 UTC
Created attachment 93529 [details, diff]

that patch wont work ... `uname -m` returns like 'x86_64' on amd64

try this instead ... you should be able to remove the stupid defconfig stuff from the linux-headers ebuild as well with it
Comment 7 Luca Barbato gentoo-dev 2006-08-05 11:50:50 UTC
on amd64 aren't you supposed to have CROSS_COMPILE set?
Comment 8 SpanKY gentoo-dev 2006-08-05 12:38:04 UTC
yes ... so i read the patch slightly wrong ...

trying to gather information out of CROSS_COMPILE is still wrong though, the user configuration settings are all that should matter
Comment 9 Luca Barbato gentoo-dev 2006-08-19 02:25:18 UTC
maybe it's my turn to misread, but CONFIG_PPC64 isn't part of .config so you won't have it while you always know what you want if you set the cross compiler to a certain value?
Comment 10 Luca Barbato gentoo-dev 2006-08-21 02:19:37 UTC
Created attachment 94758 [details, diff]
Yet another solution

Upstream won't accept the patch, rationale:
- there are different defconfigs for ppc32
- you should provide a defconfig yourself if you are cross compiling.
Comment 11 Luca Barbato gentoo-dev 2006-08-21 02:39:24 UTC
Created attachment 94759 [details, diff]
ebuild fix

typo in the previous one...
Comment 12 SpanKY gentoo-dev 2006-08-21 03:13:00 UTC
we want to move this crap out of the ebuilds, not expand upon it
Comment 13 SpanKY gentoo-dev 2006-08-27 10:19:26 UTC
*** Bug 145261 has been marked as a duplicate of this bug. ***
Comment 14 Luca Barbato gentoo-dev 2006-09-03 18:43:31 UTC
Fixed by adding some logic in the eclass