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"
Please attach a patch that makes use of this funcitonality
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 ...
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
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.
FIXED?
not quite ... i want to review CFLAG usage
ok nm, uclibc does a good job of picking 'good' CFLAGS the important part is that CPU type is configurable now