Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 492590 - sys-devel/gcc-4.8.2 fails to create a cross-compiler -- build/gcc/ seems to mix host compiler with target flags
Summary: sys-devel/gcc-4.8.2 fails to create a cross-compiler -- build/gcc/ seems to m...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Whiteboard:
Keywords:
: 492972 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-26 08:57 UTC by Sergey Popov
Modified: 2013-12-30 01:32 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,247.55 KB, text/plain)
2013-11-26 08:57 UTC, Sergey Popov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Popov gentoo-dev 2013-11-26 08:57:59 UTC
Created attachment 363998 [details]
build.log

As per summary. Build.log attached

mips64-unknown-linux-gnu-emerge --info

Portage 2.2.7 (default/linux/mips/13.0/multilib/n32, gcc-4.8.2, unavailable, 3.10.17-gentoo-BADO x86_64)
=================================================================
System uname: Linux-3.10.17-gentoo-BADO-x86_64-Intel-R-_Core-TM-_i7_CPU_950_@_3.07GHz-with-gentoo-2.2
KiB Mem:    12282408 total,   3420280 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Mon, 25 Nov 2013 23:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
sys-devel/gcc-config: 1.8
sys-libs/glibc:       2.17
Repositories: gentoo local pinkbyte
ACCEPT_KEYWORDS="mips ~mips"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=mips64r2 -mplt"
CHOST="mips64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=mips64r2 -mplt"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mini-router/Gentoo"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/mips64-unknown-linux-gnu/packages/"
PORTAGE_CONFIGROOT="/usr/mips64-unknown-linux-gnu/"
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"
PORTAGE_TMPDIR="/usr/mips64-unknown-linux-gnu/tmp/"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/crossdev /var/lib/layman/pinkbyte"
USE="acl berkdb bindist bzip2 cli cracklib crypt cxx gdbm iconv ipv6 make-symlinks minimal mips modules mudflap multilib ncurses nls nptl pam pcre readline session ssl tcpd unicode zlib" ABI_MIPS="n32" ALSA_CARDS="au1x00" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" 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" 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev impact newport dummy v4l" 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, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2013-12-02 08:15:30 UTC
Have you checked whether this option got removed upstream?
Comment 2 Matt Turner gentoo-dev 2013-12-02 08:43:23 UTC
No, the problem is that he's cross compiling and -mplt is being applied when building the cross compiler, which is not a mips binary.

This is a crossdev bug or something. Nothing for mips@ to do here.
Comment 3 Sergey Popov gentoo-dev 2013-12-02 09:50:08 UTC
(In reply to Matt Turner from comment #2)
> No, the problem is that he's cross compiling and -mplt is being applied when
> building the cross compiler, which is not a mips binary.
> 
> This is a crossdev bug or something. Nothing for mips@ to do here.

Not sure that it's nothing for mips@, cause crosscompiling gcc-4.7.3 went fine, so bug is probably in toolchain.eclass or gcc's ebuild(but i am not sure, cause i am unfamiliar with this eclass and gcc internals at all) and it would be good for us to be aware of it.

Also, i wonder, why it calls 'g++' instead of full compiler name(mips64-unknown-linux-gnu-g++), so maybe problem is there - it picks wrong(host)  compiler, that does not know anything about -mplt - poof,bang,crash! :-(
Comment 4 SpanKY gentoo-dev 2013-12-07 08:01:35 UTC
*** Bug 492972 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2013-12-07 08:02:41 UTC
seems to be a target independent issue
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2013-12-27 21:27:39 UTC
Only with 4.8?  I wonder if somewhere CXXFLAGS is leaking through.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2013-12-29 08:44:03 UTC
4.7:
gcc -c -DIN_GCC    -DGENERATOR_FILE -I. -Ibuild -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/build -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/../include -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/../libcpp/include  -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/../libdecnumber -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/../libdecnumber/dpd -I../libdecnumber    \
-DBASEVER="\"4.7.3\"" -DDATESTAMP="\"\"" \
-DREVISION="\"\"" \
-DDEVPHASE="\"\"" -DPKGVERSION="\"(Gentoo 4.7.3-r1 p1.4, pie-0.5.5) \"" \
-DBUGURL="\"<https://bugs.gentoo.org/>\"" -o build/version.o /usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/gcc/version.c

4.8:
g++ -c     -O2 -march=armv6j -mfpu=vfp -mfloat-abi=hard -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/build -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/../include -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/../libcpp/include  -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/../libdecnumber -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/../libdecnumber/dpd -I../libdecnumber -I/usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/../libbacktrace    \
-DBASEVER="\"4.8.2\"" -DDATESTAMP="\"\"" \
-DREVISION="\"\"" \
-DDEVPHASE="\"\"" -DPKGVERSION="\"(Gentoo 4.8.2 p1.1, pie-0.5.8) \"" \
-DBUGURL="\"<https://bugs.gentoo.org/>\"" -o build/version.o /usr/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/gcc/version.c

Looks like an upstream bug.  

BUILD_CXXFLAGS is initially set to $(ALL_CXXFLAGS) in gcc/configure.ac.  There is later logic to set BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' if host != build.  This logic is missing for BUILD_CXXFLAGS so it stays set to $(ALL_CFLAGS).
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2013-12-29 08:57:26 UTC
If I'm right it was fixed upstream by http://gcc.gnu.org/ml/gcc-patches/2013-12/msg00304.html