Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69871 - uclibc-0.9.26-r7 doesn't check for cpu type during the configure stage
Summary: uclibc-0.9.26-r7 doesn't check for cpu type during the configure stage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: MIPS Linux
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-02 12:37 UTC by Stephen Becker (RETIRED)
Modified: 2004-11-10 16:35 UTC (History)
1 user (show)

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 Stephen Becker (RETIRED) gentoo-dev 2004-11-02 12:37:14 UTC
When emerging uclibc for mips (SGI Indy, r4400), I noticed that it does not pick up CFLAGS from /etc/make.conf.  Doing a quick grep of the unpacked source directory shows that uclibc does indeed have the information needed to properly optimize for the different ISA levels of mips processors, and that you simply need to select the appropriate cputype/ISA level during the configure stage.

I also noticed that the configure stage selected cpu type as little endian, where all "mips" systems are big endian.  The only case where you would select little endian is if you are using a "mipsel" system such as cobalt raq/qube or other embedded mips boards.

One last little bit...the mips specific CFLAG -mabi probably needs to be read from /etc/make.conf, otherwise gcc may attempt to build 64-bit binaries by default on MIPSIII and MIPSIV systems.

Reproducible: Always
Steps to Reproduce:
1.emerge uclibc
2.
3.

Actual Results:  
Target Processor Architecture
> 1. Generic (MIPS I) (CONFIG_MIPS_ISA_1)
  2. MIPS II (CONFIG_MIPS_ISA_2)
  3. MIPS III (CONFIG_MIPS_ISA_3)
  4. MIPS IV (CONFIG_MIPS_ISA_4)
  5. MIPS32 (CONFIG_MIPS_ISA_MIPS32)
  6. MIPS64 (CONFIG_MIPS_ISA_MIPS64)
choice[1-6?]: 1
Target Processor Endianness
> 1. Little Endian (ARCH_LITTLE_ENDIAN)
  2. Big Endian (ARCH_BIG_ENDIAN)
choice[1-2?]: 1


Expected Results:  
Target Processor Architecture
  1. Generic (MIPS I) (CONFIG_MIPS_ISA_1)
  2. MIPS II (CONFIG_MIPS_ISA_2)
> 3. MIPS III (CONFIG_MIPS_ISA_3)
  4. MIPS IV (CONFIG_MIPS_ISA_4)
  5. MIPS32 (CONFIG_MIPS_ISA_MIPS32)
  6. MIPS64 (CONFIG_MIPS_ISA_MIPS64)
choice[1-6?]: 3
Target Processor Endianness
  1. Little Endian (ARCH_LITTLE_ENDIAN)
> 2. Big Endian (ARCH_BIG_ENDIAN)
choice[1-2?]: 2


Portage 2.0.51-r2 (uclibc/mips, gcc-3.4.2, uclibc-0.9.26-r7, 2.6.10-rc1 mips)
=================================================================
System uname: 2.6.10-rc1 mips R4400SC V6.0  FPU V0.0
Gentoo Base System version 1.6.4
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/mips-headers-2.4.22-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="mips ~mips"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=mips3 -mtune=r4400 -mabi=32 -pipe"
CHOST="mips-pc-linux-uclibc"
COMPILER=""
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/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=mips3 -mtune=r4400 -mabi=32 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks nodoc noinfo noman sfperms strict"
GENTOO_MIRRORS="http://gentoo.osuosl.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="mips berkdb chroot ncurses pcre perl python readline ssl tcpd uclibc zlib"
Comment 1 solar (RETIRED) gentoo-dev 2004-11-02 12:45:06 UTC
Please attach a patch that makes use of this funcitonality
Comment 2 SpanKY gentoo-dev 2004-11-02 15:48:13 UTC
i figure we force users to set variables like 'UCLIBC_CPU=mips3' and 'UCLIBC_CPU_ENDIAN=little'

if those variables arent set, we'll keep with our current autodetection routines ... i'm pretty sure the current detection of endian is wrong ...
Comment 3 SpanKY gentoo-dev 2004-11-05 23:09:01 UTC
please try this:
echo '=dev-libs/uclibc-0.9.26-r8 -*' >> /etc/portage/package.keywords
UCLIBC_CPU="help" emerge =uclibc-0.9.26-r8

i'll check out CFLAG support in a bit
Comment 4 Stephen Becker (RETIRED) gentoo-dev 2004-11-06 09:17:39 UTC
file ld-uClibc-0.9.26.so
ld-uClibc-0.9.26.so: ELF 32-bit MSB shared object, MIPS, MIPS-III version 1 (SYSV), stripped

Excellent!  Also, it seems -mabi wasn't needed.  I kind of suspected as much, but with older toolchains you needed it.
Comment 5 solar (RETIRED) gentoo-dev 2004-11-07 14:44:25 UTC
FIXED?
Comment 6 SpanKY gentoo-dev 2004-11-07 21:44:11 UTC
not quite ... i want to review CFLAG usage
Comment 7 SpanKY gentoo-dev 2004-11-10 16:35:18 UTC
ok nm, uclibc does a good job of picking 'good' CFLAGS

the important part is that CPU type is configurable now