Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587678 - dev-lang/gnat-gcc 4.9.3 setting of COMPILER_PATH corrupts environment so kernel cannot be built
Summary: dev-lang/gnat-gcc 4.9.3 setting of COMPILER_PATH corrupts environment so kern...
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: https://forums.gentoo.org/viewtopic-p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-01 09:55 UTC by Michael Mounteney
Modified: 2017-04-03 22:11 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mounteney 2016-07-01 09:55:41 UTC
/etc/env.d/55gnat-i686-pc-linux-gnu-gnat-gcc-4.9 defines COMPILER_PATH=/usr/libexec/gnat-gcc/i686-pc-linux-gnu/4.9:/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9:

This changes the list of include-paths used by gcc, with one consequence being that the kernel cannot be built.

The information in https://forums.gentoo.org/viewtopic-p-7938620.html describes the problem and is repeated here, on a system with gcc-5.4.0 active:

With COMPILER_PATH set, echo | cpp -Wp,-v outputs:
    ignoring duplicate directory "/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9/include" 
    ignoring nonexistent directory "/usr/local/include" 
    ignoring duplicate directory "/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9/include-fixed" 
    ignoring nonexistent directory "/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9/../../../../i686-pc-linux-gnu/include" 
    #include "..." search starts here: 
    #include <...> search starts here: 
     /usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9/include 
     ./include 
     /usr/lib/gnat-gcc/i686-pc-linux-gnu/4.9/include-fixed 
     /usr/include 
    End of search list. 
    # 1 "<stdin>" 
    # 1 "<built-in>" 
    # 1 "<command-line>" 
    # 1 "/usr/include/stdc-predef.h" 1 3 4 
    # 1 "<command-line>" 2 
    # 1 "<stdin>"

With it unset/cleared, echo | cpp -Wp,-v outputs:
    ignoring nonexistent directory "/usr/local/include" 
    ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/5.4.0/../../../../i686-pc-linux-gnu/include" 
    #include "..." search starts here: 
    #include <...> search starts here: 
     /usr/lib/gcc/i686-pc-linux-gnu/5.4.0/include 
     /usr/lib/gcc/i686-pc-linux-gnu/5.4.0/include-fixed 
     /usr/include 
    End of search list. 
    # 1 "<stdin>" 
    # 1 "<built-in>" 
    # 1 "<command-line>" 
    # 1 "/usr/include/stdc-predef.h" 1 3 4 
    # 1 "<command-line>" 2 
    # 1 "<stdin>"

The workaround is to unset COMPILER_PATH before building the kernel, and maybe before any emerging, although that will interfere adversely with any emerges that employ gnat-gcc.
Comment 1 Michael Mounteney 2016-07-01 09:56:47 UTC
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=haswell -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /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=haswell -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="-j5 -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="/var/tmp"
USE="3dnow 3dnowext X a52 aac acl acpi alsa autoipd avahi berkdb 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 freerdp gbm gd gdbm gif git glamor glibc-omitfp gnutls gpm gstreamer gtk handbook iconv imap inotify java jpeg jpeg2k kde kipi kpathsea lame latex lcms ldap libnotify lzma lzo mad mercurial mmap mms mng modules mp3 mp4 mpeg msn musepack ncurses 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 mmxext sse sse2 aes avx fma3 popcnt sse3 sse4_1 sse4_2 ssse3" 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" L10N="en en-GB" 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 i965" 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 2 Steve Arnold archtester gentoo-dev 2016-07-21 18:13:30 UTC
I have another "minor" fix to push to eselect-gnat, but that variable should no longer be set for gnat-gcc; did you install the latest eselect-gnat and run it?  If so, are you still seeing this problem?  The current env file should look like this, but will change soon-ish:

$ cat /etc/env.d/55gnat-x86_64-pc-linux-gnu-gnat-gcc-4.9 
PATH=/usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.9:/usr/libexec/gnat-gcc/x86_64-pc-linux-gnu/4.9:
ROOTPATH=/usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.9:/usr/libexec/gnat-gcc/x86_64-pc-linux-gnu/4.9:
MANPATH=/usr/share/gnat-gcc-data/x86_64-pc-linux-gnu/4.9/man:
INFOPATH=/usr/share/gnat-gcc-data/x86_64-pc-linux-gnu/4.9/info:
LDPATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9:/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adalib:
ADA_INCLUDE_PATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adainclude:/usr/include/ada/charles
ADA_OBJECTS_PATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adalib:
Comment 3 Michael Mounteney 2016-08-02 12:02:31 UTC
Yes, I'm seeing *a* problem ... some sort of wierdness with gcc which is only stopped by removing gnat-gcc.  Sorry but in order to be able to emerge, I've had to remove gnat-gcc for the time being, which obviously also means halting any Ada work.  I may set up a VM to work out what's going on, but too busy for now.
Comment 4 Scott McClung 2016-08-19 19:55:03 UTC
I see the same thing, and was unable to build the kernel or things that depended on the kernel (virtualbox-modules).  I had this in /etc/env.d/55gnat-x86_64-pc-linux-gnu-gnat-gcc-4.9:

PATH=/usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.9:/usr/libexec/gnat-gcc/x86_64-pc-linux-gnu/4.9:
ROOTPATH=/usr/x86_64-pc-linux-gnu/gnat-gcc-bin/4.9:/usr/libexec/gnat-gcc/x86_64-pc-linux-gnu/4.9:
MANPATH=/usr/share/gnat-gcc-data/x86_64-pc-linux-gnu/4.9/man:
INFOPATH=/usr/share/gnat-gcc-data/x86_64-pc-linux-gnu/4.9/info:
COMPILER_PATH=/usr/libexec/gnat-gcc/x86_64-pc-linux-gnu/4.9:/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9:
LDPATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9:/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adalib:
ADA_INCLUDE_PATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adainclude:
ADA_OBJECTS_PATH=/usr/lib64/gnat-gcc/x86_64-pc-linux-gnu/4.9/adalib:

I have since removed =dev-lang/gnat-gcc-4.9.3, virtual/gnat, and =app-eselect/eselect-gnat-1.5-r1, and just cleaned up the environment in order to get the system back to a working state.

I'll have to test this again on another box to see if it's a repeatable problem.
Comment 5 Steve Arnold archtester gentoo-dev 2016-08-23 06:58:56 UTC
That var should have been removed and was not; if you wan to try again, re-emerge eselect-gnat and set it for 4.9.
Comment 6 Michael Mounteney 2016-11-06 22:23:55 UTC
Yes, the problem appears to be solved now;  thank you.
Comment 7 Michael Mounteney 2017-02-22 21:45:47 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.