Hi all... I'm just trying to get a cross compiler environment going for MIPSel (and MIPS too eventually) so that I can hopefully build an updated toolchain/system environment and get Gentoo/MIPS stagebuilds back on track. One of the issues that has held me up is natively building gcc-4.4 (see bug #290891), so I'll try a canadian-cross build and see where that gets me. I've managed to scratch together enough bits to make a workable and sufficiently fast x86 computer, so this is now an option. At present, I'm trying to get a mipsel-unknown-linux-gnu toolchain built. System in use: Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.34-duron i686) ================================================================= System uname: Linux-2.6.34-duron-i686-AMD_Duron-tm-_processor-with-gentoo-1.12.13 Timestamp of tree: Sat, 12 Jun 2010 13:15:03 +0000 app-shells/bash: 4.0_p35 dev-java/java-config: 2.1.10 dev-lang/python: 2.6.4 dev-util/cmake: 2.6.4-r3 sys-apps/baselayout: 1.12.13 sys-apps/sandbox: 1.6-r2 sys-devel/autoconf: 2.63-r1 sys-devel/automake: 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc: 4.3.4 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.30-r1 ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=athlon -pipe" DISTDIR="/home/portage/distfiles" FEATURES="assume-digests buildpkg distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://www/portage http://zhouman.dyn/gentoo http://ftp.swin.edu.au/gentoo http://mirror.aarnet.edu.au/pub/gentoo" LDFLAGS="-Wl,-O1" PKGDIR="/home/portage/packages/ia32/duron/" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/portage/overlays/local" SYNC="rsync://192.168.5.1/gentoo-portage/" USE="3dnow X aac aalib acl alsa avahi berkdb bzip2 cli cracklib crypt cups cxx directfb doc dri dxr3 examples fax flac fortran gdbm gpm gtk hal hpijs iconv imagemagick ipv6 jack jadetex java jpeg kde libcaca libnotify mmap mmx mng modules mp3 mudflap ncurses nls nptl nptlonly ogg opengl openmp oss pam parport pcre perl png policykit pppd pulseaudio python qt3support qt4 readline reflection samba scanner sdl session snmp speex spl sse ssl static-ppds sysfs tcpd theora truetype udev-acl unicode vcd vidix vorbis wavpack win32codecs x86 xorg xvmc zeroconf zlib" ALSA_CARDS="via82xx usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS It's a pretty fresh install of Gentoo. I'm using latest crossdev pulled from the git repository this morning. binutils 2.20.1 built fine, linux-headers got installed without issue... but rather than compiling gcc first (kernel-only compiler) it decides to use the (i686!) host's gcc to compile parts of glibc in the midst of building headers: (I have trimmed some of the extra information; see the attachments) for dir in (long list of directories); do \ test -f $dir/syscalls.list && \ { sysdirs='(similarly long list)' \ asm_CPP='gcc -mabi=32 -c (various -I and -D options) -Wa,--noexecstack -E -x assembler-with-cpp' \ /bin/sh sysdeps/unix/make-syscalls.sh $dir || exit 1; }; \ test $dir = sysdeps/unix && break; \ done > /tmp/cross/mipsel-unknown-linux-gnu/portage/cross-mipsel-unknown-linux-gnu/glibc-2.11-r1/work/buil d-pos-mipsel-unknown-linux-gnu-headers/sysd-syscallsT cc1: error: unrecognized command line option "-mabi=32" cc1: error: unrecognized command line option "-mabi=32" cc1: error: unrecognized command line option "-mabi=32" cc1: error: unrecognized command line option "-mabi=32" cc1: error: unrecognized command line option "-mabi=32" cc1: error: unrecognized command line option "-mabi=32" MIPS CFLAGS on an x86 gcc? Dunno how that's expected to work ;-) I suspect the behaviour is supposed to be either: * Build static kernel-only gcc *first* then build glibc (which is what crossdev used to do IIRC) OR * Tell glibc to just set up its headers and not compile anything *until* gcc is installed in the next step I think modern crossdev tries to do the latter, but evidently this isn't working. I'll post the full logs in a moment. Last crossdev commit at time of clone: commit 43fce0d223dfd876970d08e4645e845c5178c33f Author: Ned Ludd <solar> Date: Sun Feb 28 14:12:47 2010 -0800 disable -q by default in git also. Signed-off-by: Ned Ludd <solar>
Created attachment 235139 [details] Failed glibc build for CTARGET=mipsel-unknown-linux-gnu CHOST=i686-pc-linux-gnu
this is correct behavior. you need the C library headers before you can build the first gcc. chances are, mips is doing something specific in glibc with their headers.
Ahh okay, I recall we used to build just a straight gcc with no libs as the "stage 1" gcc, and that could be built without headers and would work for building the kernel too. I'm just trying a run specifying --without-headers. I don't recall having issues building a toolchain on my Yeeloong for arm-926ejs-linux-gnueabi (target; Ka-Ro TX27/Freescale i.MX27) like this, so we could very well be looking at a MIPS headers issue. I'm not sure where to start looking however.
duron ~ # crossdev -t mipsel-unknown-linux-gnu --without-headers ----------------------------------------------------------------------------------------------------------------- * crossdev version: @CDEVPV@ * Host Portage ARCH: x86 * Target Portage ARCH: mips * Target System: mipsel-unknown-linux-gnu * Stage: 4 (C/C++ compiler) * binutils: binutils-[latest] * gcc: gcc-[latest] * headers: linux-headers-[latest] * libc: glibc-[latest] * PORTDIR_OVERLAY: /home/portage/overlays/local * PORT_LOGDIR: /var/log/portage * PKGDIR: /home/portage/packages/ia32/duron//cross/mipsel-unknown-linux-gnu * PORTAGE_TMPDIR: /tmp/cross/mipsel-unknown-linux-gnu _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ - ~ - _ * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ... [ ok ] * Log: /var/log/portage/cross-mipsel-unknown-linux-gnu-binutils.log * Emerging cross-binutils ... [ ok ] * Log: /var/log/portage/cross-mipsel-unknown-linux-gnu-gcc-stage1.log * Emerging cross-gcc-stage1 ... [ ok ] * Log: /var/log/portage/cross-mipsel-unknown-linux-gnu-linux-headers.log * Emerging cross-linux-headers ... [ ok ] * Log: /var/log/portage/cross-mipsel-unknown-linux-gnu-glibc.log * Emerging cross-glibc ... [ ok ] * Log: /var/log/portage/cross-mipsel-unknown-linux-gnu-gcc-stage2.log * Emerging cross-gcc-stage2 ... [ ok ] duron ~ # mipsel-unknown-linux-gnu-gcc --version mipsel-unknown-linux-gnu-gcc (Gentoo 4.4.4 p1.0) 4.4.4 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. duron ~ # mipsel-unknown-linux-gnu-as --version GNU assembler (GNU Binutils) 2.20.1.20100303 Copyright 2009 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `mipsel-unknown-linux-gnu'. duron ~ # ^^ Looking at the above, I'd say this is a viable work-around until we can get the headers issue sorted out. Now to sort out a canadian-cross toolchain, and to get my stages updated.
*** This bug has been marked as a duplicate of bug 235551 ***