Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 305739 (PR38591) - sys-devel/gcc-4.3.4 compilation fails with "error: conflicting types for 'strsignal'"
Summary: sys-devel/gcc-4.3.4 compilation fails with "error: conflicting types for 'str...
Status: RESOLVED FIXED
Alias: PR38591
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR38591
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-18 13:19 UTC by Andrew Gaffney (RETIRED)
Modified: 2011-07-01 06:02 UTC (History)
2 users (show)

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


Attachments
build log and config.log's of the failure (gcc_logs.tar.gz,86.79 KB, application/octet-stream)
2010-09-05 02:14 UTC, Israel G. Lugo
Details
build.log (build.log,1.42 MB, text/plain)
2011-01-31 04:20 UTC, Israel G. Lugo
Details
emerge --info =sys-devel/gcc-4.3.4 (info.txt,6.03 KB, text/plain)
2011-01-31 04:38 UTC, Israel G. Lugo
Details
fix missing dependency for gcc/sparseset.o (gcc-4.3.4-fix-depends.patch,584 bytes, patch)
2011-01-31 06:15 UTC, Israel G. Lugo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gaffney (RETIRED) gentoo-dev 2010-02-18 13:19:54 UTC
The latest amd64 autobuild failed in stage 1 with the following error while compiling sys-devel/gcc-4.3.4, with the following error.

x86_64-pc-linux-gnu-gcc -c   -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/. -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../include -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libcpp/include  -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber/bid -I../libdecnumber    /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c -o sparseset.o
In file included from /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c:22:
/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/system.h:418: error: conflicting types for 'strsignal'
/usr/include/string.h:564: error: previous declaration of 'strsignal' was here
make[3]: *** [sparseset.o] Error 1
make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
make: *** [bootstrap-lean] Error 2
make: INTERNAL: Exiting with 9 jobserver tokens available; should be 8!
Comment 1 Sebastian Bauer 2010-03-04 23:55:05 UTC
(In reply to comment #0)
> The latest amd64 autobuild failed in stage 1 with the following error while
> compiling sys-devel/gcc-4.3.4, with the following error.
> 
> x86_64-pc-linux-gnu-gcc -c   -O -DIN_GCC   -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
> -Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H -I. -I.
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/.
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../include
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libcpp/include 
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber
> -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber/bid
> -I../libdecnumber   
> /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c -o
> sparseset.o
> In file included from
> /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c:22:
> /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/system.h:418: error:
> conflicting types for 'strsignal'
> /usr/include/string.h:564: error: previous declaration of 'strsignal' was here
> make[3]: *** [sparseset.o] Error 1
> make[3]: Leaving directory
> `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build/gcc'
> make[2]: *** [all-stage1-gcc] Error 2
> make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
> make: *** [bootstrap-lean] Error 2
> make: INTERNAL: Exiting with 9 jobserver tokens available; should be 8!
> 

I had the same problem. Removing the USE-Flag objc has solved that problem for me.
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2010-03-05 00:43:25 UTC
This hasn't happened with later autobuilds, so I'm closing this bug.
Comment 3 Israel G. Lugo 2010-08-28 20:38:45 UTC
The problem still exists for me, on an amd64 server using hardened profile.

/var/tmp/portage/sys-devel/gcc-4.3.4/work/build/./prev-gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.3.4/work/build/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -c -DEFAULT_PIE -DEFAULT_RELRO -DEFAULT_BIND_NOW    -O2 -march=native -pipe -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros                               -Wno-overlength-strings    -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/. -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../include -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libcpp/include  -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber -I/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/../libdecnumber/bid -I../libdecnumber    /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c -o sparseset.o
In file included from /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/sparseset.c:22:
/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/system.h:418: error: conflicting types for 'strsignal'
/usr/include/string.h:564: error: previous declaration of 'strsignal' was here
make[3]: *** [sparseset.o] Error 1
make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.3.4/work/build'
make: *** [bootstrap-lean] Error 2
make: INTERNAL: Exiting with 4 jobserver tokens available; should be 3!

# emerge --info =sys-devel/gcc-4.3.4
Portage 2.1.8.3 (hardened/linux/amd64/10.0/no-multilib, gcc-4.3.4, glibc-2.11.2-r0, 2.6.28-hardened-r9 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.28-hardened-r9-x86_64-AMD_Opteron-tm-_Processor_240-with-gentoo-1.12.13
Timestamp of tree: Sat, 28 Aug 2010 19:45:01 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.5-r3, 3.1.2-r4
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=3.00"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.rnl.ist.utl.pt/pub/gentoo/gentoo-distfiles/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs=3 --load-average=3.00"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://ftp.rnl.ist.utl.pt/gentoo-portage"
USE="acl amd64 bash bash-completion berkdb bzip2 cli cracklib crypt cxx dri gdbm hardened iconv justify logrotate logwatch mmx modules mudflap ncurses nptl nptlonly openmp pam pcre perl pic pppd python readline reflection session spl sse sse2 ssl sysfs tcpd unicode urandom vim vim-syntax xorg zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 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, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

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

sys-devel/gcc-4.3.4 was built with the following:
USE="hardened mudflap nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -fortran -gcj -gtk (-libffi) (-multilib) -multislot (-n32) (-n64) -nls -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla"
Comment 4 Israel G. Lugo 2010-08-28 20:40:01 UTC
Incidentally, I am *not* using an autobuild... This is a production server which has failed its periodic updates due to this problem.
Comment 5 Israel G. Lugo 2010-09-03 02:47:05 UTC
Any news on this? The bug is still very much there, please reopen!

I have further information, which I find puzzling.

I just did the following:
# emerge -vaNuD world && emerge -ve system && emerge -ve world

1) The update completed successfully -- it only pulled in net-misc/iputils-20100418
2) emerge -ve system completed successfully (including gcc!)
3) emerge -ve world failed, with exactly the same error (!!!)

What could possibly have changed between emerge -ve system and emerge -ve world?

Could this have something to do with building multiple packages simultaneously? As you can see in my emerge --info, I am using EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=3.00"
Comment 6 SpanKY gentoo-dev 2010-09-04 23:33:09 UTC
a snippet isnt going to help.  you need to post the full build log as an attachment, as well as the config.log's from the build tree.
Comment 7 Israel G. Lugo 2010-09-05 02:14:05 UTC
Created attachment 246077 [details]
build log and config.log's of the failure

Posting the build.log and all config.logs, as requested.

The tar contains the following files:
$ tar -tzf gcc_logs.tar.gz | grep -v /$
gcc-4.3.4/work/build/gcc/config.log
gcc-4.3.4/work/build/config.log
gcc-4.3.4/work/build/libiberty/config.log
gcc-4.3.4/work/build/build-x86_64-pc-linux-gnu/libiberty/config.log
gcc-4.3.4/work/build/build-x86_64-pc-linux-gnu/fixincludes/config.log
gcc-4.3.4/work/build/libcpp/config.log
gcc-4.3.4/work/build/intl/config.log
gcc-4.3.4/work/build/libdecnumber/config.log
gcc-4.3.4/temp/build.log

As for the machine itself:
# eselect profile show
Current make.profile symlink:
  hardened/linux/amd64/10.0/no-multilib
# uname -a
Linux hostname_suppressed 2.6.28-hardened-r9 #12 SMP PREEMPT Wed Sep 1 15:28:08 WEST 2010 x86_64 AMD Opteron(tm) Processor 240 AuthenticAMD GNU/Linux

Any more information required, please ask.
Comment 8 SpanKY gentoo-dev 2010-09-07 16:34:58 UTC
can you run with MAKEOPTS=-j1 and re-post the build.log as an attachment please
Comment 9 Israel G. Lugo 2010-09-07 18:49:26 UTC
(In reply to comment #8)
> can you run with MAKEOPTS=-j1 and re-post the build.log as an attachment please
> 

I did the following:
# MAKEOPTS=-j1 emerge gcc

But the compilation was successful. In fact, I had already been able to emerge gcc just by itself before (even without the MAKEOPTS=-j1). I should have said that, sorry.

In fact, as I noted in comment 5, I've seen even stranger behavior: emerge -ve system is able to compile gcc successfully, but a subsequent emerge -ve world fails with the exact same error as described above. At least that's what happened the last couple of times I tried it.

I wonder if it's related to --jobs=2 in EMERGE_DEFAULT_OPTS somehow. Perhaps a wrong dependency somewhere, a file conflict?

I am doing a # MAKEOPTS=-j1 emerge -ve world now. It should be done sometime tomorrow; I will report back when it finishes and include the build.log (assuming the problem manifests itself).
Comment 10 Israel G. Lugo 2010-09-08 21:04:25 UTC
(In reply to comment #9)
> I am doing a # MAKEOPTS=-j1 emerge -ve world now. It should be done sometime
> tomorrow; I will report back when it finishes and include the build.log
> (assuming the problem manifests itself).
> 

The "MAKEOPTS=-j1 emerge -ve world" completed successfully, including of course GCC.

I am doing "emerge -ve world" (without the MAKEOPTS=-j1) now, to make sure the problem is still reproducible.
Comment 11 Israel G. Lugo 2010-09-09 14:33:28 UTC
(In reply to comment #10)
> I am doing "emerge -ve world" (without the MAKEOPTS=-j1) now, to make sure the
> problem is still reproducible.
> 

Ok, this is really weird. Whether or not compilation fails seems to be random. But the error -- when there is one -- is always the one cited above:
/var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/system.h:418: error: conflicting types for 'strsignal'

To summarize, here's what I've seen, in chronological order:
0. emerge -vaNuD && emerge -ve system && emerge -ve world failed. There had been a bunch of updates, about 50 of them. Repeated, failed again. Reported bug.
1. emerge -vaNuD && emerge -ve system && emerge -ve world failed, during the emerge world stage. The only update was to net-misc/iputils.
2. emerge gcc completed successfully.
3. emerge -ve system && emerge -ve world failed.
4. MAKEOPTS=-j1 emerge gcc completed successfully.
5. MAKEOPTS=-j1 emerge -ve world completed successfully.
6. emerge -ve world completed successfully.
7. emerge -vaNuD && emerge -ve system && emerge -ve world failed.

I am going to keep trying, but with MAKEOPTS=-j1, to see if I can obtain a clean build.log of the failure for you.

For the record, when the failure does manifest itself, the conflicting declarations of the strsignal function are as follows:

From /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/gcc/system.h:418:
/* If the system doesn't provide strsignal, we get it defined in
   libiberty but no declaration is supplied.  */
#if !defined (HAVE_STRSIGNAL) \
    || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
# ifndef strsignal
extern const char *strsignal (int);
# endif
#endif


From /usr/include/string.h:564:
#ifdef  __USE_XOPEN2K8 
/* Return a string describing the meaning of the signal number in SIG.  */ 
extern char *strsignal (int __sig) __THROW; 

The difference seems to be in the __THROW token.
Comment 12 Israel G. Lugo 2011-01-31 04:16:25 UTC
I have just encountered this bug again, on a different machine. This is an amd64 running gentoo-sources kernel (not hardened). Failure with "gcc/system.h:418: error: conflicting types for ‘strsignal’" when trying to emerge =sys-devel/gcc-4.3.4.

The error happened during an emerge -ve world. The compiler in use was gcc-4.4.2-r2 (latest 4.4 stable).

I have stored the build directory and can produce a .tgz on request. Please reopen the bug...
Comment 13 Israel G. Lugo 2011-01-31 04:20:22 UTC
Created attachment 261145 [details]
build.log
Comment 14 Israel G. Lugo 2011-01-31 04:38:41 UTC
Created attachment 261147 [details]
emerge --info =sys-devel/gcc-4.3.4

Problem occurred during an emerge -ve world, with EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=3.00 --with-bdeps=y" and MAKEOPTS="-j3 --load-average=3"; there were other jobs running at the time. Could the intermittent nature that's been seen in this bug report be a sign of some kind of race condition?
Comment 15 Israel G. Lugo 2011-01-31 05:57:27 UTC
I think I've found the immediate cause of the problem.

I resumed the emerge -ve world, and it failed again, with the same error. On the third attempt, I increased CPU priority for the gcc-4.3.4 sandbox and all subprocesses, and managed to make it past the point of failure (i.e. when attempting to compile gcc-4.3.4/gcc/sparseset.c).

I copied the working directory while it was still in progress and made a recursive diff. I discovered that in both failed attempts, the file gcc-4.3.4/work/build/gcc/config.h was missing. On the attempt which succeeded, the file was present.

This makes sense: the "previous declaration" that the error mentions is in gcc-4.3.4/work/gcc/system.h, as follows:

/* If the system doesn't provide strsignal, we get it defined in
   libiberty but no declaration is supplied.  */
#if !defined (HAVE_STRSIGNAL) \
    || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
# ifndef strsignal
extern const char *strsignal (int);
# endif
#endif

It's only supposed to declare strsignal if the system doesn't declare it (as detected by configure). If the config.h file is missing, the HAVE_STRSIGNAL macro will obviously not be defined, so we get the duplicate definition.

I believe this is strong evidence towards a race condition, caused by a missing dependency on gcc/config.h somewhere. Parallel builds will trigger it sooner or later.

Can someone with hands-on experience on gcc's build system please verify?
Comment 16 Israel G. Lugo 2011-01-31 06:15:03 UTC
Created attachment 261154 [details, diff]
fix missing dependency for gcc/sparseset.o

Found the problem and created a patch. gcc/sparseset.c includes "config.h" but gcc/Makefile.in doesn't have it listed as a dependency for sparseset.o.

I've just checked and gcc-4.4.4 doesn't have the problem; the dependency is there.

Please integrate this patch into a new stable gcc-4.3.4-r1 or something...
Comment 17 SpanKY gentoo-dev 2011-02-06 18:33:39 UTC
thanks for figuring this out
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2011-07-01 06:02:31 UTC
Released in 4.3.4 p1.3.