Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 545316

Summary: sys-devel/gcc-4.8.4: /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c:629:18: error: format not a string literal and no format arguments [-Werror=format-security] 0, message);
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED INVALID    
Severity: normal CC: abandonedaccountubdprczb8hs, dflogeras2, thican
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 259417    
Attachments: emerge log
gcc build log
build.log.gz
emerge --info

Description Toralf Förster gentoo-dev 2015-04-02 11:43:39 UTC
config.status: creating Makefile
config.status: creating ada/gcc-interface/Makefile
config.status: creating ada/Makefile
config.status: creating auto-host.h
config.status: executing default commands
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.4/work/build'
Makefile:17740: recipe for target 'stage2-bubble' failed
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.4/work/build'
Makefile:17946: recipe for target 'bootstrap-lean' failed
make: *** [bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-4.8.4::gentoo failed (compile phase):
 *   emake failed
Comment 1 Toralf Förster gentoo-dev 2015-04-02 11:44:36 UTC
Created attachment 400380 [details]
emerge log
Comment 2 Toralf Förster gentoo-dev 2015-04-02 11:44:54 UTC
Created attachment 400382 [details]
gcc build log
Comment 3 Thibaud CANALE 2015-04-02 14:02:16 UTC
Created attachment 400390 [details]
build.log.gz

Failed to compile as well, but not with the same errors:

In file included from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:32:0:
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:500:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
 extern const char *strsignal (int);
                                  ^
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/cstring:42:0,
                 from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:205,
                 from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:32:
/usr/include/string.h:563:14: error: previous declaration ‘char* strsignal(int)’ here
 extern char *strsignal (int __sig) __THROW;
              ^
In file included from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:645:0,
                 from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:32:
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/../include/libiberty.h:110:36: error: new declaration ‘char* basename(const char*)’
 extern char *basename (const char *);
                                    ^
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/cstring:42:0,
                 from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:205,
                 from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:32:
/usr/include/string.h:600:26: error: ambiguates old declaration ‘const char* basename(const char*)’
 extern "C++" const char *basename (const char *__filename)
                          ^
In file included from /var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:32:0:
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:289:56: error: ‘CHAR_BIT’ was not declared in this scope
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                        ^
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:290:44: note: in expansion of macro ‘INTTYPE_MINIMUM’
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/system.h:294:20: note: in expansion of macro ‘INTTYPE_MAXIMUM’
 # define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char)
                    ^
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype.h:455:23: note: in expansion of macro ‘UCHAR_MAX’
   CHAR_TOKEN_OFFSET = UCHAR_MAX + 1,
                       ^
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c: In function ‘void write_state(const char*)’:
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/gcc/gengtype-state.c:1208:13: error: ‘time’ was not declared in this scope
   time (&now);
             ^
Makefile:1070: recipe for target 'gengtype-state.o' failed
make[3]: *** [gengtype-state.o] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc'
Makefile:4153: recipe for target 'all-stage1-gcc' failed
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.4/work/build'
Makefile:16937: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.4/work/build'
Makefile:17252: recipe for target 'bootstrap-lean' failed
make: *** [bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-4.8.4::gentoo failed (compile phase):
 *   emake failed
Comment 4 Thibaud CANALE 2015-04-02 14:03:38 UTC
Created attachment 400392 [details]
emerge --info
Comment 5 Thibaud CANALE 2015-04-02 20:13:04 UTC
About my comments, which do not concern the same bug, I made a new report, bug 545356.
Comment 6 Toralf Förster gentoo-dev 2015-04-02 22:17:58 UTC
FWIW, tried it again and think this is related to the failure :


Apr  2 23:35:12 t44 kernel: [108976.306033] PAX: PCID detected
Apr  2 23:35:12 t44 kernel: [108976.306035] PAX: strong UDEREF enabled
Apr  2 23:35:12 t44 kernel: [108976.306036] PAX: INVPCID detected
Apr  2 23:35:12 t44 kernel: [108976.320253] PAX: PCID detected
Apr  2 23:35:12 t44 kernel: [108976.320255] PAX: strong UDEREF enabled
Apr  2 23:35:12 t44 kernel: [108976.320255] PAX: INVPCID detected
Apr  2 23:35:12 t44 kernel: [108976.334564] PAX: PCID detected
Apr  2 23:35:12 t44 kernel: [108976.334565] PAX: strong UDEREF enabled
Apr  2 23:35:12 t44 kernel: [108976.334565] PAX: INVPCID detected


Apr  2 23:36:27 t44 kernel: [109051.039614] grsec: time set by /usr/sbin/ntpd[ntpd:3778] uid/euid:0/0 gid/egid:0/0, parent /sbin/init[init:1] uid/euid:0/0 gid/egid:0/0
Apr  3 00:05:28 t44 kernel: [110794.524369] grsec: Segmentation fault occurred at 000002e57a2270d8 in /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/cc1plus[cc1plus:26579] uid/euid:250/250 gid/egid:250/250, parent /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/xgcc[xgcc:26578] uid/euid:250/250 gid/egid:250/250
Apr  3 00:05:28 t44 kernel: [110794.524400] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/cc1plus[cc1plus:26579] uid/euid:250/250 gid/egid:250/250, parent /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/xgcc[xgcc:26578] uid/euid:250/250 gid/egid:250/250
Apr  3 00:06:06 t44 kernel: [110832.752637] grsec: Segmentation fault occurred at 0000028eeabb40a8 in /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/cc1plus[cc1plus:3046] uid/euid:250/250 gid/egid:250/250, parent /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/xgcc[xgcc:3045] uid/euid:250/250 gid/egid:250/250
Apr  3 00:06:06 t44 kernel: [110832.752658] grsec: denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/cc1plus[cc1plus:3046] uid/euid:250/250 gid/egid:250/250, parent /var/tmp/portage/sys-devel/gcc-4.8.4/work/build/gcc/xgcc[xgcc:3045] uid/euid:250/250 gid/egid:250/250
Comment 7 Toralf Förster gentoo-dev 2015-04-02 22:18:56 UTC
And here the missing emerge --info of my system:

tfoerste@t44 ~ $ emerge --info gcc      
Portage 2.2.14 (python 3.3.5-final-0, hardened/linux/amd64, gcc-4.8.3, glibc-2.20-r2, 3.19.3-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.19.3-hardened-x86_64-Intel-R-_Core-TM-_i5-4300U_CPU_@_1.90GHz-with-gentoo-2.2
KiB Mem:    12053240 total,   3236272 free
KiB Swap:   16777212 total,  16777036 free
Timestamp of tree: Thu, 02 Apr 2015 21:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.1.9 [disabled]
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/ccache:          3.1.9-r4
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.11
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.12.6, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.6
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.20-r2
Repositories: gentoo toralf
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -Wformat -Werror=format-security"
CHOST="x86_64-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-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/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 -pipe -march=native -Wformat -Werror=format-security"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --nospinner --tree --quiet-build --deep --autounmask --autounmask-unrestricted-atoms --autounmask-write"
FCFLAGS="-O2 -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 -pipe"
GENTOO_MIRRORS="http://ftp.daum.net/gentoo/ http://mirror.netcologne.de/gentoo/ http://gentoo.mirror.dkm.cz/pub/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X acl aes-ni alsa amd64 apache2 avx avx2 berkdb bzip2 cli corefonts cracklib crypt cups custom-cflags custom-optimization cxx dbus dnssec dri drmkms dvd ecc ffmpeg fontconfig fortran fpm gdbm git gnuplot gtk gudev gui hardened help iconv icu isag jpeg justify libav libvirtd logrotate mbox minizip mmx mmxext modules multilib mysql ncurses nls nptl ogg opengl openmp pam pax_kernel pcre pcre16 plasma png policykit qemu qt3support qt5 readline session spice sse sse2 sse4 sse4_1 sse4_2 ssh-askpass ssl ssse3 svg system-cairo system-icu system-jpeg system-libvpx system-sqlite tcpd theora thinkpad threads tk tls truetype uml unicode urandom usb usbredir uxa v4l v4l2 video vorbis vpx xa xattr xkb xmp xscreensaver xtpax xvfb xvmc zenmap zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 synaptics" 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_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

sys-devel/gcc-4.8.3 was built with the following:
USE="cxx fortran hardened (multilib) nls nptl openmp (-altivec) (-awt) -doc (-fixed-point) -gcj -go -graphite (-libssp) -mudflap (-multislot) -nopie -nossp -objc -objc++ -objc-gc -regression-test (-sanitize) -vanilla" ABI_X86="64"
CFLAGS="-O2 -pipe -march=native"
CXXFLAGS="-O2 -pipe -march=native"
Comment 8 Toralf Förster gentoo-dev 2015-04-06 13:20:43 UTC
Pff - seesm to be a local problem.

neither 4.8.3 nor 4.9.2 can be build now.
But was possible i the past :

tfoerste@t44 ~ $ qlop --gauge --human --list gcc-4
Sun Dec 14 18:33:52 2014 >>> sys-devel/gcc-4.8.3

FWIW I built 4.8.3 w/ the shipped glibc of the image rather with owb  compiled _

tfoerste@t44 ~ $ qlop --gauge --human --list glibc
Mon Dec 29 20:51:28 2014 >>> sys-libs/glibc-2.19-r1
Mon Mar 23 16:22:39 2015 >>> sys-libs/glibc-2.20-r2
glibc: Mon Dec 29 20:33:21 2014: 18 minutes, 7 seconds
glibc: Mon Mar 23 16:05:50 2015: 16 minutes, 49 seconds
glibc: 2 times
Comment 9 Toralf Förster gentoo-dev 2015-04-06 15:28:08 UTC
With kernel vanilla kernel 4.0.0-rc6 and removing "-Wformat -Werror=format-security" from CFLAGS in make.conf gcc-4.8.4 was emerged fine.
Comment 10 David Flogeras 2015-04-10 13:53:06 UTC
I had this issue on a couple xen instances.  I found it odd that other very similar machines (hardened, same kernel) did not fail.  Then I noticed in my dmesg of the failing machines that the OOM killer was doing its thing.  The failing machines needed more than 1024M RAM to succesfully build gcc.  Not sure if this will help the reporter, but worth a shot.
Comment 11 Toralf Förster gentoo-dev 2015-04-10 13:57:07 UTC
(In reply to David Flogeras from comment #10)
> I had this issue on a couple xen instances.  I found it odd that other very
> similar machines (hardened, same kernel) did not fail.  Then I noticed in my
> dmesg of the failing machines that the OOM killer was doing its thing.  The
> failing machines needed more than 1024M RAM to succesfully build gcc.  Not
> sure if this will help the reporter, but worth a shot.

Hhm, I do have 16GB here and no OOM in the message log
Comment 12 abandoned account 2015-04-14 18:16:38 UTC
Have same error, except that when I look higher it may be something else!
As you can see here it's about z_failed not being declared:
...
checking how to run the C preprocessor... libtool: link: (cd ".libs" && rm -f "liblto_plugin.so.0" && ln -s "liblto_plugin.so.0.0.0" "liblto_plugin.so.0")
libtool: link: (cd ".libs" && rm -f "liblto_plugin.so" && ln -s "liblto_plugin.so.0.0.0" "liblto_plugin.so")
x86_64-pc-linux-gnu-gcc -E
libtool: link: ( cd ".libs" && rm -f "liblto_plugin.la" && ln -s "../liblto_plugin.la" "liblto_plugin.la" )
/var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/fixincludes/fixincl.c: In function ‘fix_applies’:
/var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/fixincludes/fixincl.c:1070:32: error: ‘z_failed’ undeclared (first use in this function)
               fprintf (stderr, z_failed, "TEST", p_fixd->fix_name,
                                ^
/var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/fixincludes/fixincl.c:1070:32: note: each undeclared identifier is reported only once for each function it appears in
Makefile:76: recipe for target 'fixincl.o' failed
make[3]: *** [fixincl.o] Error 1
make[3]: *** Waiting for unfinished jobs....
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/fixincludes/server.c: In function ‘server_setup’:
/var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2/fixincludes/server.c:195:10: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
   getcwd (buff, MAXPATHLEN + 1);
          ^
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build/build-x86_64-pc-linux-gnu/fixincludes'
Makefile:2635: recipe for target 'all-build-fixincludes' failed
make[2]: *** [all-build-fixincludes] Error 2
make[2]: *** Waiting for unfinished jobs....
/bin/grep -E
checking for ANSI C header files... libtool: install: /usr/bin/install -c .libs/liblto_plugin.so.0.0.0 /var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin/.././gcc/liblto_plugin.so.0.0.0
libtool: install: (cd /var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin/.././gcc && { ln -s -f liblto_plugin.so.0.0.0 liblto_plugin.so.0 || { rm -f liblto_plugin.so.0 && ln -s liblto_plugin.so.0.0.0 liblto_plugin.so.0; }; })
libtool: install: (cd /var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin/.././gcc && { ln -s -f liblto_plugin.so.0.0.0 liblto_plugin.so || { rm -f liblto_plugin.so && ln -s liblto_plugin.so.0.0.0 liblto_plugin.so; }; })
libtool: install: /usr/bin/install -c .libs/liblto_plugin.lai /var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin/.././gcc/liblto_plugin.la
libtool: install: warning: remember to run `libtool --finish /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.2'
make[4]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin'
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build/lto-plugin'
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes

...

checking for shared library run path origin... done
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depdir commands
mkdir -p -- .deps
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build'
Makefile:17481: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build'
Makefile:17812: recipe for target 'bootstrap-lean' failed
make: *** [bootstrap-lean] Error 2
 * ERROR: sys-devel/gcc-4.9.2::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gcc-4.9.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-4.9.2::gentoo'`.
 * The complete build log is located at '/var/log/portage/ebuild.logs/build/sys-devel/gcc-4.9.2:20150414-173904.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/sys-devel/gcc-4.9.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-4.9.2/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-devel/gcc-4.9.2/work/build'
 * S: '/var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-4.9.2'
 * 
 * Please include /var/tmp/portage/sys-devel/gcc-4.9.2/work/gcc-build-logs.tar.bz2 in your bug report.
 * 
===========

Fixed(for me) by replacing this /etc/portage/make.conf line:
CFLAGS="-O2 -pipe -march=native -Wstack-protector -fstack-protector-all -g3 -DDEBUG"
with this one:
CFLAGS="-O2 -pipe -march=native -Wstack-protector -fstack-protector-all -g3"

aka removed "-DDEBUG"

this probably also fixes gnutls having a similar issue like so:

/var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c: In function 'main':
/var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c:256:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   gnutls_transport_set_ptr(state, (gnutls_transport_ptr_t)
                                   ^
In file included from ./cli-debug-args.h:49:0,
                 from /var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c:37:
/var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c: In function 'cmd_parser':
./cli-debug-args.h:89:59: error: 'INDEX_OPT_1' undeclared (first use in this function)
 #define         DESC(n) (gnutls_cli_debugOptions.pOptDesc[INDEX_OPT_## n])
                                                           ^
./cli-debug-args.h:91:41: note: in expansion of macro 'DESC'
 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
                                         ^
/var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c:332:6: note: in expansion of macro 'HAVE_OPT'
  if (HAVE_OPT(DEBUG))
      ^
./cli-debug-args.h:89:59: note: each undeclared identifier is reported only once for each function it appears in
 #define         DESC(n) (gnutls_cli_debugOptions.pOptDesc[INDEX_OPT_## n])
                                                           ^
./cli-debug-args.h:91:41: note: in expansion of macro 'DESC'
 #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
                                         ^
/var/tmp/portage/net-libs/gnutls-3.3.10-r2/work/gnutls-3.3.10/src/cli-debug.c:332:6: note: in expansion of macro 'HAVE_OPT'
  if (HAVE_OPT(DEBUG))
      ^
Makefile:1831: recipe for target 'cli-debug.o' failed
make[4]: *** [cli-debug.o] Error 1


Yes in fact it does fix it, just tested (that is, removing -DDEBUG from CFLAGS fixes this gnutls issue too!)
I guess I can't use -DDEBUG in CFLAGS *sadface* (i didn't want debug USE flag though, that is too crazy! eg. for vim creates .log files in current dir - insane!  I only wanted "my" assert()s hehe)
-----------

-------------------------
OP's error is probably this(from his build.log):
...
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c: In function ‘unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, source_location)’:
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c:629:18: error: format not a string literal and no format arguments [-Werror=format-security]
        0, message);
                  ^
/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c:632:39: error: format not a string literal and no format arguments [-Werror=format-security]
           virtual_location, 0, message);
                                       ^
configure: creating cache ./config.cache
cc1plus: some warnings being treated as errors
Makefile:223: recipe for target 'expr.o' failed
make[3]: *** [expr.o] Error 1

...
but comment #9 says it got fixed...

anyway, cheers.
Comment 13 abandoned account 2015-04-14 18:22:05 UTC
and in case anyone reading is wondering why the real error(s) are scattered like that, my guess is: it's because of -j4  or anything above -j1 (aka parallel whateverness) eg. I have MAKEOPTS="-j4" in make.conf
Comment 14 Toralf Förster gentoo-dev 2015-04-14 20:32:27 UTC
Gha, the culprit is neither -j3 nor any mysterious thing here.
The root issue is sitting in front of the computer - sry.

In short :

$ grep -Hri error: | grep '\-Werror=format\-security'
build.log:/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c:629:18: error: format not a string literal and no format arguments [-Werror=format-security]
build.log:/var/tmp/portage/sys-devel/gcc-4.8.4/work/gcc-4.8.4/libcpp/expr.c:632:39: error: format not a string literal and no format arguments [-Werror=format-security]


I just forgot to remove "-Wformat -Werror=format-security" from CFLAGS after I played with it for a short while ....
Comment 15 abandoned account 2015-04-14 21:41:06 UTC
yup, as I mentioned at the end of comment #12 , you did fix it in comment #9
"
removing "-Wformat -Werror=format-security" from CFLAGS in make.conf
"


Cheers
Comment 16 Toralf Förster gentoo-dev 2015-04-15 20:11:53 UTC
invalid, b/c "PEBKAC" isn't available as a menu drop down entry