Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 495208 - hardened sys-devel/gcc-4.7.3-r1 fails to build: cc1plus segfaults
Summary: hardened sys-devel/gcc-4.7.3-r1 fails to build: cc1plus segfaults
Status: RESOLVED OBSOLETE
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:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-24 10:46 UTC by Nikoli
Modified: 2015-01-26 21:07 UTC (History)
3 users (show)

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


Attachments
build.log.xz (gcc-4.7.3-r1_buid.log.xz,91.47 KB, application/octet-stream)
2013-12-24 10:46 UTC, Nikoli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikoli 2013-12-24 10:46:50 UTC
Created attachment 366082 [details]
build.log.xz

gcc-4.7.3-r1.ebuild,v 1.14 fails to build in one of my hardened systems, in several systems it builds fine. Not sure why exactly it happens here, but it seems to start failing after migrating to xattr based pax marking. But in other migrated system gcc rebuilds fine.

May be cc1 and cc1plus should be pax marked '-r' in src_compile too, not only in src_install.

# cat /boot/config-3.12.6-hardened |grep _PT_ -a3
# PaX Control
#
# CONFIG_PAX_SOFTMODE is not set
# CONFIG_PAX_PT_PAX_FLAGS is not set
CONFIG_PAX_XATTR_PAX_FLAGS=y
CONFIG_PAX_NO_ACL_FLAGS=y
# CONFIG_PAX_HAVE_ACL_FLAGS is not set

build.log:
checking pthread.h usability... a.out
checking whether the C compiler works... configure: error: in `/var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/32/libquadmath':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
a.out
checking whether the C compiler works... yes
yes
checking pthread.h presence... checking whether we are cross compiling... no
checking for suffix of executables... yes
checking for pthread.h... yes
checking for thread model used by GCC... posix
checking for dlsym in -ldl... 
checking for suffix of object files... make[1]: *** [configure-target-libquadmath] Error 1
make[1]: *** Waiting for unfinished jobs....


dmesg:
Dec 24 07:29:43 kernel: [90063.219201] cc1plus[17037]: segfault at 377d81f79d0 ip 0000000001114a41 sp 0000039b813b02a0 error 4 in cc1plus[400000+118b000]
Dec 24 07:29:43 kernel: [90063.219226] grsec: Segmentation fault occurred at 00000377d81f79d0 in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:17037] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:17036] uid/euid:250/250 gid/egid:250/250
Dec 24 07:29:43 kernel: [90063.219247] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:17037] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:17036] uid/euid:250/250 gid/egid:250/250
Dec 24 07:30:27 kernel: [90107.368408] cc1plus[25526]: segfault at 2c366e04a28 ip 0000000001114a41 sp 000003d6f9651820 error 4 in cc1plus[400000+118b000]
Dec 24 07:30:27 kernel: [90107.368432] grsec: Segmentation fault occurred at 000002c366e04a28 in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:25526] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:25525] uid/euid:250/250 gid/egid:250/250
Dec 24 07:30:27 kernel: [90107.368451] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:25526] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:25525] uid/euid:250/250 gid/egid:250/250
Dec 24 07:56:47 kernel: [91687.271867] cc1plus[10049]: segfault at 2a6f3566ac4 ip 0000000000d8bf69 sp 000003ccd2d6db50 error 4 in cc1plus[400000+d64000]
Dec 24 07:56:47 kernel: [91687.271894] grsec: Segmentation fault occurred at 000002a6f3566ac4 in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:10049] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:10048] uid/euid:250/250 gid/egid:250/250
Dec 24 07:56:47 kernel: [91687.271914] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:10049] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:10048] uid/euid:250/250 gid/egid:250/250
Dec 24 07:57:21 kernel: [91721.349962] cc1plus[18027]: segfault at 35c0720f2ec ip 0000000000d8bf69 sp 000003f78bbbc810 error 4 in cc1plus[400000+d64000]
Dec 24 07:57:21 kernel: [91721.349985] grsec: Segmentation fault occurred at 0000035c0720f2ec in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:18027] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:18026] uid/euid:250/250 gid/egid:250/250
Dec 24 07:57:21 kernel: [91721.350033] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:18027] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:18026] uid/euid:250/250 gid/egid:250/250
Dec 24 08:10:58 kernel: [92538.378965] cc1plus[2378]: segfault at 39bfdf02cfc ip 0000000000d8bf69 sp 000003f8eb315d10 error 4 in cc1plus[400000+d64000]
Dec 24 08:10:58 kernel: [92538.378990] grsec: Segmentation fault occurred at 0000039bfdf02cfc in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:2378] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:2376] uid/euid:250/250 gid/egid:250/250
Dec 24 08:10:58 kernel: [92538.379030] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:2378] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:2376] uid/euid:250/250 gid/egid:250/250
Dec 24 08:11:33 kernel: [92572.996182] cc1plus[10454]: segfault at 322597aa1b4 ip 0000000000d8bf69 sp 000003f5c261ce50 error 4 in cc1plus[400000+d64000]
Dec 24 08:11:33 kernel: [92572.996205] grsec: Segmentation fault occurred at 00000322597aa1b4 in /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:10454] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:10453] uid/euid:250/250 gid/egid:250/250
Dec 24 08:11:33 kernel: [92572.996223] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/cc1plus[cc1plus:10454] uid/euid:250/250 gid/egid:250/250, parent /var/package-manager/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/gcc/xgcc[xgcc:10453] uid/euid:250/250 gid/egid:250/250


Portage 2.2.7 (hardened/linux/amd64, gcc-4.7.3, glibc-2.16.0, 3.12.6-hardened x86_64)
=================================================================
                        System Settings
=================================================================
KiB Mem:     4045044 total,    870336 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Tue, 24 Dec 2013 02:45:02 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo nikoli
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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"
PORTDIR_OVERLAY="/var/lib/layman/nikoli"
USE="X a52 aac acl acpi alsa amd64 amr audiofile bash-completion bzip2 cairo caps cdda cddb cdio cdparanoia cdr celt cli consolekit cracklib crypt css cups cxx dbus dc1394 djvu dri dts dv dvd dvdr encode exif fat ffmpeg flac fluidsynth fontconfig fortran gd geoip gif gimp gmp gnutls gphoto2 gpm graphviz gsm gstreamer gtk handbook hardened iconv icu id3tag idn ieee1394 ilbc imagemagick imap imlib ios ipod ipv6 jbig jpeg jpeg2k justify kde kipi lame laptop lcms libass libnotify libproxy libsamplerate lm_sensors lzma lzo mac mad matroska mikmod mmx mmxext modplug modules mp3 mp4 mpeg mtp mudflap multilib musepack musicbrainz ncurses networkmanager nls nptl nptlonly ntfs nvidia ogg openal openexr opengl openmp opus pam pango pax_kernel pcre pdf pg-intdatetime phonon plasma pm-utils png policykit postscript qt3support qt4 quicktime rar raw readline reiserfs replaygain rtmp sasl scanner session sid smp sndfile socks5 speex spell sqlite sse sse2 sse3 ssl ssse3 startup-notification svg symlink sysfs taglib theora threads thumbnail tiff truetype tta udev udisks unicode upnp upower usb v4l v4l2 vcd vorbis vpx wavpack webkit webp wifi wma wmf x264 xattr xcb xcomposite xface xinerama xml xmp xpm xscreensaver xv xvid xz zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="*" 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer" LINGUAS="ru ru_RU en" NGINX_MODULES_HTTP="access auth_basic autoindex fastcgi gzip rewrite" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="nouveau modesetting vesa" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.7.3-r1 was built with the following:
USE="cxx fortran hardened mudflap (multilib) nls nptl openmp test (-altivec) -doc (-fixed-point) -gcj -go -graphite -gtk (-libssp) -lto -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla" ABI_X86="64"
Comment 1 Martin Väth 2013-12-24 18:25:17 UTC
This seems to be related with hardened-sources-3.12.6:

I have the same issue, but not only with gcc.
For example, xrdb gets killed, too. (However, X itself starts...)

With hardened-sources-3.12.5-r1 there is no such problem.
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-24 18:45:51 UTC
follow the guide here to migrate to xt_pax fully.

https://wiki.gentoo.org/wiki/Hardened/PaX_flag_migration_from_PT_PAX_to_XATTR_PAX

I had this problem as well.


What kernel and what filesystem are you using?
Comment 3 Martin Väth 2013-12-24 21:15:49 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #2)
> follow the guide here to migrate to xt_pax fully.

xrdb (and I suppose also gcc) should not require special PAX exceptions, at least only the standard -e--- is marked for the executables (in case of xrdb this is simpler to check).
Moreover, why should hardened-sources-3.12.6 suddenly have dropped the support for PT despite the announcements and .config options?
If possible, I would like to postpone the conversion as long as possible to avoid problems with backups/tarfiles/...

> What kernel and what filesystem are you using?

The problematic kernel is obviously hardened-sources-3.12.6 for Nikoli and me.
In my case, the filesystem is ext4, security labels are working.
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-24 21:33:32 UTC
(In reply to Martin Väth from comment #3)
> (In reply to Matthew Thode ( prometheanfire ) from comment #2)
> > follow the guide here to migrate to xt_pax fully.
> 
> xrdb (and I suppose also gcc) should not require special PAX exceptions, at
> least only the standard -e--- is marked for the executables (in case of xrdb
> this is simpler to check).
> Moreover, why should hardened-sources-3.12.6 suddenly have dropped the
> support for PT despite the announcements and .config options?
> If possible, I would like to postpone the conversion as long as possible to
> avoid problems with backups/tarfiles/...
> 
> > What kernel and what filesystem are you using?
> 
> The problematic kernel is obviously hardened-sources-3.12.6 for Nikoli and
> me.
> In my case, the filesystem is ext4, security labels are working.

xrdb links against cc1 somewhere, which is -e--- for ptpax, but not for xtpax, xtpax is -----.

the logic changed and now if xtpax is found at all (even if -----) it will be used.  if that xattr is not set at all (not even -----) then it will fall back to pt_pax.  This was stated in the config option. use a modern tar, it supports xattrs now :D
Comment 5 Martin Väth 2013-12-25 00:15:30 UTC
> xrdb links against cc1 somewhere

You are right (it seems that it calls cpp which in turn calls cc1).

> which is -e--- for ptpax, but not for xtpax, xtpax is -----.

This would mean that the gcc ebuild is broken, wouldn't it?
However, here it was different:

# paxctl-ng -v /usr/libexec/gcc/i686-pc-linux-gnu/4.8.2/cc1
/usr/libexec/gcc/i686-pc-linux-gnu/4.8.2/cc1:
        PT_PAX    : -e-r-
        XATTR_PAX : not found

Using paxctl-ng -F ... on cc1 and cc1plus "fixes" the issue with 3.12.6 nevertheless. However, this seems wrong, since if XATTR_PAX is "not found" the kernel should fall back to PT_PAX, shouldn't it?

Summarizing, I would say this is a bug in hardened-sources-3.12.6 of not recognizing the headers as documented (and thus breaking compatibility with earlier hardened-sources kernel).
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-25 00:21:15 UTC
(In reply to Martin Väth from comment #5)
> > xrdb links against cc1 somewhere
> 
> You are right (it seems that it calls cpp which in turn calls cc1).
> 
> > which is -e--- for ptpax, but not for xtpax, xtpax is -----.
> 
> This would mean that the gcc ebuild is broken, wouldn't it?
> However, here it was different:
> 
> # paxctl-ng -v /usr/libexec/gcc/i686-pc-linux-gnu/4.8.2/cc1
> /usr/libexec/gcc/i686-pc-linux-gnu/4.8.2/cc1:
>         PT_PAX    : -e-r-
>         XATTR_PAX : not found
> 
> Using paxctl-ng -F ... on cc1 and cc1plus "fixes" the issue with 3.12.6
> nevertheless. However, this seems wrong, since if XATTR_PAX is "not found"
> the kernel should fall back to PT_PAX, shouldn't it?
> 
> Summarizing, I would say this is a bug in hardened-sources-3.12.6 of not
> recognizing the headers as documented (and thus breaking compatibility with
> earlier hardened-sources kernel).

well, you need to follow the migration guide I linked earlier.  Also, guess I was wrong about that '-e-r-' is what it's set to.
Comment 7 Nikoli 2013-12-25 01:21:09 UTC
Downgrading to 3.12.5-hardened-r1 did not help. System where gcc fails is used as binhost, so i tried rebuilding gcc in one of clients: it worked fine, twice.

Why gcc fails to rebuild in one system and builds fine in other almost identical?

Portage 2.2.7 (hardened/linux/amd64, gcc-4.7.3, glibc-2.16.0, 3.12.6-hardened x86_64)
=================================================================
                        System Settings
=================================================================
KiB Mem:     3063736 total,   2223116 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Tue, 24 Dec 2013 23:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo nikoli
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
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"
PORTDIR_OVERLAY="/var/lib/layman/nikoli"
USE="X a52 aac acl acpi alsa amd64 amr audiofile bash-completion bzip2 cairo caps cdda cddb cdio cdparanoia cdr celt cli consolekit cracklib crypt css cups cxx dbus dc1394 djvu dri dts dv dvd dvdr encode exif fat ffmpeg flac fluidsynth fontconfig fortran gd geoip gif gimp gmp gnutls gphoto2 gpm graphviz gsm gstreamer gtk handbook hardened iconv icu id3tag idn ieee1394 ilbc imagemagick imap imlib ios ipod ipv6 jbig jpeg jpeg2k justify kde kipi lame laptop lcms libass libnotify libproxy libsamplerate lm_sensors lzma lzo mac mad matroska mikmod mmx mmxext modplug modules mp3 mp4 mpeg mtp mudflap multilib musepack musicbrainz ncurses networkmanager nls nptl nptlonly ntfs nvidia ogg openal openexr opengl openmp opus pam pango pax_kernel pcre pdf pg-intdatetime phonon plasma pm-utils png policykit postscript qt3support qt4 quicktime rar raw readline reiserfs replaygain rtmp sasl scanner session sid smp sndfile socks5 speex spell sqlite sse sse2 sse3 ssl ssse3 startup-notification svg symlink sysfs taglib theora threads thumbnail tiff truetype tta udev udisks unicode upnp upower usb v4l v4l2 vcd vorbis vpx wavpack webkit webp wifi wma wmf x264 xattr xcb xcomposite xface xinerama xml xmp xpm xscreensaver xv xvid xz zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="*" 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" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer" LINGUAS="ru ru_RU en" NGINX_MODULES_HTTP="access auth_basic autoindex fastcgi gzip rewrite" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="nouveau modesetting vesa" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.7.3-r1 was built with the following:
USE="cxx fortran hardened mudflap (multilib) nls nptl openmp test (-altivec) -awt -doc (-fixed-point) -gcj -go -graphite (-libssp) -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla" ABI_X86="64"
Comment 8 Martin Väth 2013-12-25 08:54:12 UTC
(In reply to Nikoli from comment #0)
> # CONFIG_PAX_PT_PAX_FLAGS is not set

Maybe you have set this in one machine but not in the other?
If it is unset, it is clear that the fallback to PT_PAX cannot work.
The problem is that even setting it seems to be ignored in 3.12.6

(In reply to Matthew Thode ( prometheanfire )
> well, you need to follow the migration guide I linked earlier.

Can you please explain the behviour?
According to the migration guide the output

 PT_PAX: something
 XATTR_PAX: not found

should be ok. Or do I misunderstand something completely, here?
As explained, "by accident" it works after paxctl-ng -F (which to my understanding is the same as migrate -m for these files), but to my understanding this should be neither neceesary nor is it a permanent fix: After reemerging gcc, I got the same "broken" flags again which do not work with 3.12.6, i.e. one would manually have to call migrate -m after every emerge (maybe even reemering gcc itself would not be possible with 3.12.6; I did not try, since every such experiment takes many hours on my machine).
Comment 9 Nikoli 2013-12-25 09:01:42 UTC
CONFIG_PAX_PT_PAX_FLAGS is not set in both.
Comment 10 Martin Väth 2013-12-25 13:51:37 UTC
Setting explicitly PAX_MARKINGS="PT XT" in /etc/portage/make.conf made the emerge work "correctly". I am surprised, because I had read that this is currently the default, but apparently the current default is still PAX_MARKINGS="PT".

However, I still do not understand why PAX_MARKINGS="PT" does not work with 3.6.12 (when no xattr is used); IMHO it should (with CONFIG_PAX_PT_PAX_FLAGS=y, of course).

(In reply to Nikoli from comment #9)
> CONFIG_PAX_PT_PAX_FLAGS is not set in both.

Then I am wondering why it works on one of your machines... maybe you had emerged with PAX_MARKINGS="PT XT" or PAX_MARKINGS="XT"? Does
  paxctl-ng -v [path to your cc1 or cc1plus]
show the same output on both machines?
Comment 11 Nikoli 2013-12-25 14:43:44 UTC
Both have PAX_MARKINGS="XT". binhost provider (where gcc fails to rebuild) has:
# paxctl-ng -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1*
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1:
        PT_PAX    : -e-r-
        XATTR_PAX : -e-r-

/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1plus:
        PT_PAX    : -e-r-
        XATTR_PAX : -e-r-


binhost user has:
# paxctl-ng -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1*
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1:
        PT_PAX    : -e---
        XATTR_PAX : -e-r-

/usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1plus:
        PT_PAX    : -e---
        XATTR_PAX : -e-r-
Comment 12 Martin Väth 2013-12-25 16:03:12 UTC
(In reply to Nikoli from comment #11)
> binhost user has:
> # paxctl-ng -v /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1*
> /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1:
>         PT_PAX    : -e---
>         XATTR_PAX : -e-r-
> 
> /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1plus:
>         PT_PAX    : -e---
>         XATTR_PAX : -e-r-

Since the two data differ, both are ignored. Fix with
paxctl-ng -f /usr/libexec/gcc/x86_64-pc-linux-gnu/4.7.3/cc1*
Comment 13 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-25 23:06:37 UTC
I'll say this one more time :P

the logic pax used with markings changed for the 3.12.6 release

previously if xt paxmarkings were found they would be used, if they were ----- they would fall back on pt markings.

now, if xt paxmarking are found they will be used, even if -----.  This is why you are having problems.

I have removed the keywords from =sys-kernel/hardened-sources-3.12.6.
Comment 14 Nikoli 2013-12-26 03:18:00 UTC
I found what was different in these 2 systems using 'time equery --no-pipe --no-color check '*' &> /tmp/world_verify' command:
!!! /lib64/ld-linux.so.2 does not exist

'emerge -1vka glibc' solved problem, gcc recompiled fine. Do not know why /lib64/ld-linux.so.2 was removed, may be it is time to buy new hdd.
Comment 15 Martin Väth 2013-12-26 11:32:17 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #13)
> now, if xt paxmarking are found they will be used, even if -----.

So far I had understood that "no xt paxmarking" is something else than "-----", but maybe the misunderstanding is that this is the same? Namely, if this is something else then I would have expected that the output of paxctl-ng -v ...

  XATTR_PAX: not found

means "no xt paxmarking" (hence fallback to PT_PAX), and that otherwise I would have seen

  XATTR_PAX: -----

Moreover, if emerging without setting PAX_MARKINGS explicitly, I would also expect that either "no xt paxmarking" is produced (hence fallback to PT_PAX) or the correct ones, but not "-----". However, reproducible

  XATTR_PAX: not found

behaves with hardened-sources-3.12.6 like

  XATTR_PAX: -----

according to your description. So maybe my misunderstanding was that these two are actually identical (which would explain everything, of course).

For the records: The "workaround" (setting PAX_MARKINGS="PT XT" and calling migrate-pax -m once) works, of course.
Comment 16 Magnus Granberg gentoo-dev 2015-01-26 21:07:02 UTC
Open if it still happens