Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586538 - dev-lang/gnat-gcc: old lto wrapper breaks newer gcc (e.g. using -march=native)
Summary: dev-lang/gnat-gcc: old lto wrapper breaks newer gcc (e.g. using -march=native)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2016-06-20 23:59 UTC by Michael Mounteney
Modified: 2024-03-11 22:45 UTC (History)
1 user (show)

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


Attachments
config.log from ebuild of sys-apps/systemd (gentoo_emerge_config.log.txt,18.33 KB, text/plain)
2016-06-21 00:00 UTC, Michael Mounteney
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mounteney 2016-06-20 23:59:01 UTC
The attached config.log is from the attempt to emerge sys-apps/systemd but just about every build (except, curiously, gcc) has the same symptoms; it seems that automake is attempting to run i686-pc-linux-gnu-gcc as though it takes the same command-line options as gcc, but it doesn't, so the configuration, hence the build, fails.

Before the last emaint sync -a, I ran emerge -quUDN @world ; emerge -q @preserved-rebuild ; emerge --depclean -q ; prelink -amR which ran to completion without errors. Then I ran emaint sync -a and attempted emerge -quUDN @world again, which is when the problem began. It seems that the sync has pulled something in that is causing the problem.

However, emerge -q gcc did work, and installed gcc-5.4.0. After it completed, I switched to it with gcc-config 2 ; source /etc/profile and tried the emerge -quUDN @world again, but it still failed with the same config error. 

Reproducible: Always

Steps to Reproduce:
1.  emerge -q @world
Actual Results:  
Every package ebuild fails with a config.log containing similar to the attached.

Expected Results:  
The packages should be built and installed.

The workaround is to specify the processor in /etc/portage/make.conf, line CFLAGS.

Replace -march=native with -march=your_processor.  In this particular case, this is pentium-m but a similar bug manifests on an Intel NUC with a Haswell chipset;  in that case, -march=haswell works around the bug.
Comment 1 Michael Mounteney 2016-06-21 00:00:46 UTC
Created attachment 438226 [details]
config.log from ebuild of sys-apps/systemd

All ebuilds are failing;  this bug is not specific to sys-apps/systemd but was observed on all ebuilds during an attempted emerge -q @world.
Comment 2 Michael Mounteney 2016-06-21 00:01:32 UTC
Portage 2.3.0_rc1 (python 2.7.11-final-0, default/linux/x86/13.0/desktop/plasma/systemd, gcc-5.4.0, glibc-2.23-r2, 4.5.2-gentoo i686)
=================================================================
System uname: Linux-4.5.2-gentoo-i686-Intel-R-_Pentium-R-_M_processor_1.86GHz-with-gentoo-2.2
KiB Mem:     1025520 total,    148212 free
KiB Swap:    2003364 total,   1950804 free
Timestamp of repository gentoo: Sun, 19 Jun 2016 01:30:01 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
ccache version 3.2.5 [disabled]
app-shells/bash:          4.3_p42-r2::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo
dev-util/ccache:          3.2.5::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

Installed sets: @kde5-laptop, @powerful
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /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=pentium-m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://ftp.swin.edu.au/gentoo http://mirror.pacific.net.au/linux/Gentoo ftp://ftp.swin.edu.au/gentoo ftp://mirror.pacific.net.au/linux/Gentoo "
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3 -s"
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="/mnt/home"
USE="3dnow 3dnowext X a52 aac acl acpi alsa autoipd avahi berkdb bluetooth branding bzip2 cairo cdda cdr cli cracklib crypt cups cxx dbus declarative disk-partition doc dri dts dv dvb dvd dvdr embedded emboss encode exif extras fam firefox flac fontconfig foomatic fortran gbm gd gdbm gif git glamor glibc-omitfp gnutls gpm gstreamer gtk handbook iconv imap inotify ipmi java jpeg jpeg2k kde kipi kpathsea lame laptop latex lcms ldap libnotify lzma lzo mad mercurial mmap mms mng modules mp3 mp4 mpeg msn musepack ncurses networkmanager nfsv41 nls nntp npp nptl nsplugin odbc ogg openexr opengl openmp oscar oss pam pango pcre pdf phonon plasma png policykit postgres ppds pulseaudio qml qt5 quicktime rdesktop readline real rss sasl sdl seccomp semantic-desktop session slang smime spam-report spamassassin spell sql ssh ssl startup-notification subversion svg systemd taglib tcpd theora threads tiff truetype udev udisks unicode upower usb v4l2 vaapi vcd vim-syntax vnc vorbis wavpack wayland webkit widgets win32codecs wmf wxwidgets x264 x86 xattr xcb xcomposite xface xine xinerama xml xnest xpm xscreensaver xv xvid yahoo zlib" ABI_X86="32" ALSA_CARDS="atiixp" 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" CPU_FLAGS_X86="mmx sse sse2" CURL_SSL="gnutls" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="intel" 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
Comment 3 Michael Mounteney 2016-06-21 00:02:36 UTC
With reference to the comment about a Haswell machine failing, all my Gentoo machines share a common NFS4-mounted /usr/portage.
Comment 4 Michael Mounteney 2016-06-21 04:50:24 UTC
I'm not saying it's not gcc but I've been on 5.3.0 for at least a month now and only encountered the bug in the last two days.  Also, 5.4.0 demonstrates the same problem.  It would be surprising if so great a regression remained unfixed across a minor release.
Comment 5 SpanKY gentoo-dev 2016-06-21 06:12:54 UTC
probably related to this:
COLLECT_LTO_WRAPPER=/usr/libexec/gnat-gcc/i686-pc-linux-gnu/4.9/lto-wrapper

i doubt it's gcc's fault
Comment 6 Steve Arnold archtester gentoo-dev 2016-06-25 20:12:43 UTC
I can see it in the attached log file, but not here:

Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/5.3.0/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/5.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/5.3.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/python --enable-languages=c,c++,jit,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.3.0 p1.0, pie-0.6.5' --enable-libstdcxx-time --enable-host-shared --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts --enable-lto --with-isl --disable-isl-version-check --enable-libsanitizer
Thread model: posix
gcc version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5) 

But I seem to have a couple of issues to fix so disabling lto on gnat-gcc seems like a Good Plan...
Comment 7 Steve Arnold archtester gentoo-dev 2016-06-25 22:20:02 UTC
(In reply to Michael Mounteney from comment #4)
> I'm not saying it's not gcc but I've been on 5.3.0 for at least a month now
> and only encountered the bug in the last two days.  Also, 5.4.0 demonstrates
> the same problem.  It would be surprising if so great a regression remained
> unfixed across a minor release.

I'm not seeing any wrapper issues (as mentioned above) and no build failures on world yet.  If you do have gnat-gcc installed you can try rebuilding or removing it and see if that helps.  I haven't seen any side-effects on ~x86 or ~amd64 multilib (or even ~arm) including hardened variants.  Maybe Spanky has a clue how you got the wrong COLLECT_LTO_WRAPPER setting but at this point all I can think of is check your files under /etc/ld.so.conf.d/ for anything funny, run gcc-config again, and then eselect gnat-gcc to make sure everything is set (gcc-config will reset your ld.so config so check again after to see if anything funny got back in there).
Comment 8 Michael Mounteney 2016-06-25 22:51:58 UTC
You'll have to ask SpanKY since he changed the title to include a reference to gnat-gcc.  Although I do emerge gnat-gcc, I never referenced it in my original report, and as far as I know, sys-apps/systemd does not have any Ada code.

I suggest we change the title back to the original ("sys-devel/gcc appears not to be able to work with -march=native; needs architecture to be specified") in order not to be diverted into problems with gnat-gcc and LTO.
Comment 9 Steve Arnold archtester gentoo-dev 2016-07-21 19:16:11 UTC
I disabled lto config option for gnat-gcc so please update and try again.  Should be fixed...
Comment 10 Michael Mounteney 2016-08-02 12:02:35 UTC
I don't know what's going on exactly but I get all sorts of wierdness with gcc whenever gnat-gcc is installed.  Regrettably I've had to remove it for now so I can continue to emerge.
Comment 11 Steve Arnold archtester gentoo-dev 2016-08-23 06:56:23 UTC
That weirdness should also be gone (now).  Not sure why it was still there in the first place...
Comment 12 Michael Mounteney 2016-08-23 11:07:29 UTC
I don't really get that Steve.  It was gnat-gcc-4.9.3 that was giving the problem, and that is still the latest version in portage.  I was expecting gnat-gcc-4.9.3-r1 or similar.  Surely you didn't fix it but retain the version?
Comment 13 Michael Mounteney 2016-11-06 22:25:32 UTC
(In reply to Michael Mounteney from comment #12)
> I don't really get that Steve.  It was gnat-gcc-4.9.3 that was giving the
> problem, and that is still the latest version in portage.  I was expecting
> gnat-gcc-4.9.3-r1 or similar.  Surely you didn't fix it but retain the
> version?

Well whatever the version number, it appears that the problem is solved so thank you.
Comment 14 Michael Mounteney 2017-02-22 21:45:59 UTC
I would like to take over maintenance of this package but do need help.  I'm a programmer but have never been involved in emerge or portage beyond trivial fixes and don't know how to take a new release of FSF gnat-gcc from .tar.gz to an ebuild update.  I assume there is a canned process of some sort involving packaging and unit tests.