Given my only valid profile seems to be default/linux/mips/13.0/multilib/n32 and the stage3 toolchain is built "--with-abi=n32" I don't understand why the profile keeps trying to enforce "--with-abi=32" which causes it to looks for gnu/stubs-o32_hard.h (which fails miserably). Can someone please explain the profile flags? I tried passing "--with-abi=n32" via EXTRA_ECONF but it must be getting stripped out. This after rebuilding glibc and binutils, which leads to my second issue of broken ld.gold symlink because there's no gold linker. No idea why... # emerge --info Portage 2.2.28 (python 3.5.1-final-0, default/linux/mips/13.0/multilib/n32, gcc-5.3.0, glibc-2.22-r1, 4.5.1 mips64) ================================================================= System uname: Linux-4.5.1-mips64-Cavium_Octeon+_V0.1-with-gentoo-2.2 KiB Mem: 384724 total, 23220 free KiB Swap: 1048572 total, 1034860 free Timestamp of repository gentoo: Mon, 09 May 2016 10:30:01 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-lang/perl: 5.22.1::gentoo dev-lang/python: 2.7.11-r2::gentoo, 3.4.3-r7::gentoo, 3.5.1-r2::gentoo dev-util/pkgconfig: 0.29::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/openrc: 0.19.1::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.69-r1::gentoo sys-devel/automake: 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo sys-devel/binutils: 2.25.1-r1::arm_support sys-devel/gcc: 5.3.0::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6-r1::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.5::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-umask: 022 sync-uri: rsync://prime.arnolds.bogus/gentoo-portage sync-user: portage:portage priority: -1000 eclass-overrides: nerdboy arm_support location: /usr/local/arm masters: gentoo priority: 0 nerdboy location: /usr/local/portage masters: gentoo priority: 1 ACCEPT_KEYWORDS="mips ~mips" ACCEPT_LICENSE="* -@EULA @GPL-COMPATIBLE @OSI-APPROVED @EULA dlj-1.1 Oracle-BCLA-JavaSE" CBUILD="mips64-unknown-linux-gnu" CFLAGS="-O2 -pipe -march=mips3 -mtune=mips3 -mabi=n32 -mplt -fforce-addr" CHOST="mips64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=mips3 -mtune=mips3 -mabi=n32 -mplt -fforce-addr" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://localnet/gentoo/" LANG="en_US.utf8" LDFLAGS="-O2 -pipe -march=mips3 -mtune=mips3 -mabi=n32 -mplt -fforce-addr -fwhole-program" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="acl alsa berkdb bindist bzip2 caps cli consolekit cracklib crypt cryptodev curl cxx dnotify evdev fbcon fortran gdbm gnutls gudev guile hardened iconv inotify ipv6 jpeg logrotate lua lzma mips modules multilib ncurses nls nolvmstatic nptl pam pax pcre pic pkcs11 png python qt readline seccomp session ssh ssl tcpd tls udev unicode vala wheel xattr zip zlib" ABI_MIPS="n32" ALSA_CARDS="au1x00" APACHE2_MODULES="actions alias auth_digest 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 proxy proxy_connect proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev" 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: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 434024 [details] build log fail (slightly too big)
# emerge -pqv '=sys-devel/gcc-5.3.0' [ebuild R ] sys-devel/gcc-5.3.0 [5.3.0] USE="cxx jit* (multilib*) nls nptl (-altivec) (-awt) (-cilk) -debug -doc -fixed-point -fortran -gcj -go -graphite (-hardened) (-libssp) -multislot -nopie -nossp -objc -objc++ -objc-gc -openmp -regression-test (-sanitize) -vanilla (-vtv)" * IMPORTANT: 9 news items need reading for repository 'gentoo'. * Use eselect news read to view new items. linux-gnu/include -isystem /usr/mips64-unknown-linux-gnu/sys-include -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -mabi=32 -O2 -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no -fPIC -I. -I. -I../../.././gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/. -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../include -DHAVE_CC_TLS -o _m16stubdc9.o -MT _m16stubdc9.o -MD -MP -MF _m16stubdc9.dep -DL_m16stubdc9 -xassembler-with-cpp -c /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/config/mips/mips16.S -include _m16stubdc9.vis /var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/ -B/usr/mips64-unknown-linux-gnu/bin/ -B/usr/mips64-unknown-linux-gnu/lib/ -isystem /usr/mips64-unknown-linux-gnu/include -isystem /usr/mips64-unknown-linux-gnu/sys-include -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -mabi=32 -O2 -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no -fPIC -I. -I. -I../../.././gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/. -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../include -DHAVE_CC_TLS -o _m16stubdc10_s.o -MT _m16stubdc10_s.o -MD -MP -MF _m16stubdc10_s.dep -DSHARED -DL_m16stubdc10 -xassembler-with-cpp -c /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/config/mips/mips16.S /var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/nm -pg _m16stubdc10_s.o | gawk 'NF == 3 && $2 !~ /^[UN]$/ && $3 !~ /.*_compat/ && $3 !~ /.*@.*/ { print "\t.hidden", $3 }' > _m16stubdc10.visT mv -f _m16stubdc10.visT _m16stubdc10.vis /var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/ -B/usr/mips64-unknown-linux-gnu/bin/ -B/usr/mips64-unknown-linux-gnu/lib/ -isystem /usr/mips64-unknown-linux-gnu/include -isystem /usr/mips64-unknown-linux-gnu/sys-include -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -mabi=32 -O2 -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no -fPIC -I. -I. -I../../.././gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/. -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../include -DHAVE_CC_TLS -o _m16stubdc10.o -MT _m16stubdc10.o -MD -MP -MF _m16stubdc10.dep -DL_m16stubdc10 -xassembler-with-cpp -c /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/config/mips/mips16.S -include _m16stubdc10.vis /var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/./gcc/ -B/usr/mips64-unknown-linux-gnu/bin/ -B/usr/mips64-unknown-linux-gnu/lib/ -isystem /usr/mips64-unknown-linux-gnu/include -isystem /usr/mips64-unknown-linux-gnu/sys-include -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -mabi=32 -O2 -g -O2 -pipe -march=mips3 -mtune=mips3 -mplt -minterlink-mips16 -DIN_GCC -fPIC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fstack-check=no -fPIC -I. -I. -I../../.././gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/. -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../gcc -I/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS In file included from /usr/include/features.h:389:0, from /usr/include/stdio.h:27, from /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/../gcc/tsystem.h:87, from /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/libgcc/libgcc2.c:27: /usr/include/gnu/stubs.h:11:33: fatal error: gnu/stubs-o32_hard.h: No such file or directory compilation terminated. Makefile:477: recipe for target '_muldi3.o' failed make[5]: *** [_muldi3.o] Error 1 make[5]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/mips64-unknown-linux-gnu/32/libgcc' Makefile:1172: recipe for target 'multi-do' failed make[4]: *** [multi-do] Error 1 make[4]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/mips64-unknown-linux-gnu/libgcc' Makefile:117: recipe for target 'all-multi' failed make[3]: *** [all-multi] Error 2 make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build/mips64-unknown-linux-gnu/libgcc' Makefile:14447: recipe for target 'all-stage1-target-libgcc' failed make[2]: *** [all-stage1-target-libgcc] Error 2 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build' Makefile:16827: recipe for target 'stage1-bubble' failed make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build' Makefile:17158: recipe for target 'bootstrap-lean' failed make: *** [bootstrap-lean] Error 2 * ERROR: sys-devel/gcc-5.3.0::arm_support failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/gcc-5.3.0::arm_support'`, * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-5.3.0::arm_support'`. * The complete build log is located at '/var/log/portage/sys-devel:gcc-5.3.0:20160511-161441.log'. * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-5.3.0/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/build' * S: '/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0' * * Please include /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-build-logs.tar.bz2 in your bug report. * >>> Failed to emerge sys-devel/gcc-5.3.0, Log file: >>> '/var/log/portage/sys-devel:gcc-5.3.0:20160511-161441.log'
multilib means it will try building both n32 (-mabi=n32) and o32 (-mabi=32). If you only want a single ABI, use the non-multilib profile (default/linux/mips/13.0/n32). It's on my TODO list to try and build new multilib stages for the SGIs at least, at some point, but time and hardware issues have been getting in the way. Still half-way done with a 20160506 stage run for just the single-ABI cases... Unless you specifically need O32 userland, running N32 should work fine, since you're on a mips64r2 system. That gives you the hybrid 32-bit support that can fully-utilize the 64bit capabilities of the processor, which O32 can't do (and doesn't have the cache-overhead of full N64).
Thanks, since the profiles changed since the last time and the mips (multilib, abi mostly) config stuff in general doesn't seem to be documented much, an explanation of the Gentoo profiles/abis would really help. Is there a document I missed or maybe a drafty one somewhere? The only reason I switched profiles in the first place was because the others failed to build even simple packages so I ended up on multilib/n32 as "working". Eventually I figured out I was missing the gold linker (no idea why yet, so maybe another bug is coming...) After switching profiles gcc finally rebuilt itself; it just took ~3 days on the edgerouter, so now I'm trying qemu to see if it's any faster...
(In reply to Steve Arnold from comment #4) > Thanks, since the profiles changed since the last time and the mips > (multilib, abi mostly) config stuff in general doesn't seem to be documented > much, an explanation of the Gentoo profiles/abis would really help. Is there > a document I missed or maybe a drafty one somewhere? A news item was drafted about the profile changes back in 2014. 'eselect news list' should show that item on a MIPS box as: 2014-10-04 Restructuring of mips profiles > The only reason I switched profiles in the first place was because the > others failed to build even simple packages so I ended up on multilib/n32 as > "working". Eventually I figured out I was missing the gold linker (no idea > why yet, so maybe another bug is coming...) AFAIK, the gold linker didn't work very well on MIPS yet. All of the stages I am building right now are using the older BFD linker. I don't plan on trying gold out anytime soon until after making sure gcc-6.x doesn't horrifically break things. > After switching profiles gcc finally rebuilt itself; it just took ~3 days on > the edgerouter, so now I'm trying qemu to see if it's any faster... Doubtful. What's killing you on the edgerouter is probably lack of secondary CPU cache (L2 or scache). My old cobalt RaQ2 was similarly affected. 250MHz RM5231, 256MB RAM, could build gcc-4.x fine. It just took 24+ hours many years ago because that processor only had the standard mix of L1 cache, but not L2. Even 1MB of L2 cache significantly improved things. Also, make sure you have "-fixed-point" added to USE, either globally or in package.use. Optionally, disable "fortran", "mudflap" and "openmp" as well. Not commonly used under MIPS anyways (in Gentoo, at least), so it'll speed up the build a little bit. But you'll likely see the biggest change by making sire fixed-point is disabled, as on my SGI Octane, that option alone can add ~12 hours to the build. Right now, with that and the other items disabled, a full gcc-5.3.0 build on the Octane is about ~16 hours (dual R14000 @ 600MHz). Also, gcc uses c++ for much of its code now, and as any longtime user of Gentoo knows, c++ is itself slow to build :)
(In reply to Joshua Kinard from comment #5) > (In reply to Steve Arnold from comment #4) > > Thanks, since the profiles changed since the last time and the mips > > (multilib, abi mostly) config stuff in general doesn't seem to be documented > > much, an explanation of the Gentoo profiles/abis would really help. Is there > > a document I missed or maybe a drafty one somewhere? > > A news item was drafted about the profile changes back in 2014. 'eselect > news list' should show that item on a MIPS box as: > > 2014-10-04 Restructuring of mips profiles > oh yeah, i remember that one.