Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 295480 - sys-devel/gcc-3.4.6-r2 fails to compile with gcc-4.4.2: .../build/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/libstdc++.so.6)
Summary: sys-devel/gcc-3.4.6-r2 fails to compile with gcc-4.4.2: .../build/gcc/libgcc_...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 301156 391247 523028 529500 599330 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-02 19:16 UTC by Andrew Savchenko
Modified: 2022-10-01 04:24 UTC (History)
11 users (show)

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


Attachments
build.log (build.log,1.82 MB, text/plain)
2009-12-02 19:18 UTC, Andrew Savchenko
Details
environment (environment,191.89 KB, text/plain)
2009-12-02 19:18 UTC, Andrew Savchenko
Details
build.log gcc:4.1 using gcc:4.9 (gcc-build-logs.tar.bz2,222.53 KB, application/x-bzip2)
2014-10-26 13:12 UTC, Justin Lecher (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2009-12-02 19:16:32 UTC
Hello,

I'm want to compile gcc-3.4 with my system compiler gcc-4.4.2. And I got the following:

make -j2 -s xgcc
config.h is unchanged
tm.h is unchanged
bconfig.h is unchanged
tm_p.h is unchanged
gtyp-gen.h is unchanged
gencheck.h is unchanged
specs.h is unchanged
multilib.h is unchanged
/usr/libexec/gcc/i686-pc-linux-gnu/4.4.2/cc1: /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/build/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/libstdc++.so.6)
/usr/libexec/gcc/i686-pc-linux-gnu/4.4.2/cc1: /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/build/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/libstdc++.so.6)
make: *** [gcc.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [intl.o] Error 1

For this compilation I used rather minimalistic USE="fortran nls", all other USE flags were disabled. ccache and distcc were disabled for test compilation too.

General info:

$ emerge --info
Portage 2.2_rc54 (default/linux/x86/10.0, gcc-4.4.2, glibc-2.11-r0, 2.6.31.5-yoruichi i686)
=================================================================
System uname: Linux-2.6.31.5-yoruichi-i686-AMD_Athlon-tm-_XP_3200+-with-gentoo-2.0.1
Timestamp of tree: Sun, 29 Nov 2009 14:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.1.0_beta1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r2
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.6.3, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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 /etc/udev/rules.d"
CXXFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests ccache collision-protect distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
GENTOO_MIRRORS=" ftp://orionis/distributions/1Linux/gentoo/portage ftp://ftp.chg.ru/pub/Linux/gentoo http://mirror.yandex.ru/gentoo-distfiles  ftp://ftp.corbina.net/pub/Linux/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo http://mirror.netcologne.de/gentoo"
LANG="en_US.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1"
LINGUAS="ru en ja"
MAKEOPTS="-j2"
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"
PORTDIR_OVERLAY="/usr/local/portage/layman/science /usr/local/portage/layman/java-overlay /usr/local/portage/layman/sunrise /usr/local/portage/layman/x11 /usr/local/portage/layman/kde-sunset /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi adns afs aften aim aio alsa amr amrnb amrwb ao audiofile bash-completion bcmath bidi binfilter blas bluetooth branding bzip2 cairo calendar canna caps ccache cddb cdinstall cdparanoia cdr chasen cjk cleartype cli clisp colordiff cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx cyrillic dbus device-mapper dga dia dirac directfb djvu dmx doc dri dts dv dvd dvdr dvdread dvi editor elf encode enscript ermt examples exif expat faac faad fbcon festival ffmpeg fftw firefox flac fontconfig foomaticdb fortran fpx freetds freetype ftp gallium gcj gcrypt gd gdbm geoip ggi gif gimp ginac git glibc-omitfp glitz glut gmp gnuplot gnutls gpgme gphoto2 gpm gps graphite graphviz gs gsl gsm gtk gucharmap h224 h281 h323 hdf5 hdri iconv icq icu id3tag idn imagemagick imap imlib immqt-bc inkjar ipod iproute2 ipv6 jabber jack jadetex java6 javascript jbig jingle jpeg jpeg2k kdehiddenvisibility kerberos keyscrub kpathsea kqemu ladspa lame lapack lash latex lcms libcaca libnotify libsamplerate libwww lm_sensors logrotate lzma lzo mad maildir mailwrapper matroska md5sum mhash mikmod mime mjpeg mmap mmx mng modplug modules mp3 mpeg mplayer mppe-mppc msn mudflap musepack musicbrainz mysql mysqli nas ncurses netcdf network network-cron nls nntp nocd nodrm nptlonly nsplugin nuv objc objc++ offensive ogg openal opencore-amr openexr opengl oscar otr pam pango pcntl pcre pda pdf perl pgf plotutils png pop portaudio posix postproc postscript ppds pppd pronounce pstricks qt3 qt3support qt4 quicktime raw rdesktop readline recode reflection restrict-javascript rle rrdtool samba scanner schroedinger sdl session sharedmem shorten sip sipim slang slp smi smime sms smtp sndfile sockets socks5 soundtouch sox sparse speex spell spl sqlite sqlite3 srtp sse ssl startup-notification strong-optimization subversion supernodal svg svga sysfs syslog szip t1lib taglib tcpd theora tiff timezone timidity tordns truetype twolame type3 unicode usb utempter v4l v4l2 vamp vcd videos vim vim-syntax vnc vorbis wav wavpack wifi win32codecs wireshark wmf x264 x86 xattr xcb xface xft xinerama xorg xosd xpm xprint xrandr xscreensaver xulrunner xv xvid yahoo yaz ziffy zlib" ALSA_CARDS="intel8x0" 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="authz_host dir mime" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en ja" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa nouveau"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Andrew Savchenko gentoo-dev 2009-12-02 19:18:27 UTC
Created attachment 211807 [details]
build.log
Comment 2 Andrew Savchenko gentoo-dev 2009-12-02 19:18:53 UTC
Created attachment 211809 [details]
environment
Comment 3 Andrew Savchenko gentoo-dev 2009-12-03 10:09:43 UTC
With the same setup gcc-3.3.6-r1 compiles ok. So please fix stable.

(What I really need from those old compilers is g77, because I must work with outdated undocumented braindead fortran software which cannot be compiled with gfortran because it use a lot of nonstandard g77 features removed in gfortran.)
Comment 4 Alex Brandt (RETIRED) gentoo-dev 2009-12-18 20:12:39 UTC
gfortran should compile F77 programs just fine in all of their crappy glory.  Just make sure the extension is correct so that gfortan knows to use the deprecated stuff.  Your file extension should be .f77 or .F77 depending on whether you want the preprocessor run or not.  

If this doesn't work please post back the results of the build so we can potentially check that as well.
Comment 5 Andrew Savchenko gentoo-dev 2009-12-18 23:02:27 UTC
(In reply to comment #4)
> gfortran should compile F77 programs just fine in all of their crappy glory. 
> Just make sure the extension is correct so that gfortan knows to use the
> deprecated stuff.  Your file extension should be .f77 or .F77 depending on
> whether you want the preprocessor run or not.  
> 
> If this doesn't work please post back the results of the build so we can
> potentially check that as well.

This has nothing to do with file extensions. Applications I use depends on libg2c. This library is not present in gfortran, but was present in g77.
Comment 6 Andrew Savchenko gentoo-dev 2009-12-18 23:05:39 UTC
(In reply to comment #5)
> (In reply to comment #4)
> This has nothing to do with file extensions. Applications I use depends on
> libg2c. This library is not present in gfortran, but was present in g77.
 
After taking libg2c from g77 and linking against it with gfortran applications work as expected. So what I really need is libg2c, not g77, but the only way to install it in Gentoo is to install gcc-3.{34} with USE=gfortran

[sorry, sent previous message too early]
Comment 7 SpanKY gentoo-dev 2009-12-29 07:07:47 UTC

*** This bug has been marked as a duplicate of bug 287667 ***
Comment 8 SpanKY gentoo-dev 2011-06-18 18:07:21 UTC
not a dupe after all
Comment 9 SpanKY gentoo-dev 2011-06-18 18:07:36 UTC
*** Bug 301156 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2011-06-21 01:44:57 UTC
*** Bug 372377 has been marked as a duplicate of this bug. ***
Comment 11 Duncan Exon Smith 2011-06-21 13:24:53 UTC
(In reply to comment #10)
> *** Bug 372377 has been marked as a duplicate of this bug. ***

Just a note for anyone looking for a workaround:  gcc-4.1.2 will compile for me with the following use flags:
 USE="doc fortran gtk mudflap multilib nptl"
Specifically, I needed to add USE=-nls to compile.  This may work for gcc-3.4.6-r2 as well (I'm not sure; I haven't tried).
Comment 12 Martin von Gagern 2011-09-19 18:24:06 UTC
Bug #372377 comment #7 has a patch by me to solve that problem, i.e. errors by msgfmt. It won't solve the errors by cc1 that comment #0 quotes, though. So I suppose that bug isn't necessarily a duplicate of this one here.

Perhaps a similar solution can be applied to the cc1 case as well, but as I fail to reproduce that here on my system in the first case, I'm not sure.
Comment 13 Martin von Gagern 2011-11-16 09:24:55 UTC
(In reply to comment #12)
> Bug #372377 comment #7 has a patch by me to solve [...] errors by msgfmt.

Bit me again today. Any chance of getting this patch applied? It's really short, and easy to verify. So please either apply that patch, or un-dupe and re-open bug #372377 so that the patch and possible alternatives can be discussed there.
Comment 14 Ryan Hill (RETIRED) gentoo-dev 2011-11-23 01:49:25 UTC
*** Bug 391247 has been marked as a duplicate of this bug. ***
Comment 15 Alex Brandt (RETIRED) gentoo-dev 2014-09-06 15:21:46 UTC
Has the status of this bug changed in the last three years?  Is the patch still needed to solve an issue?

If I don't hear anything by Sept 20, I'll assume this is no longer an issue and mark it invalid.
Comment 16 SpanKY gentoo-dev 2014-09-17 22:54:20 UTC
*** Bug 523028 has been marked as a duplicate of this bug. ***
Comment 17 Justin Lecher (RETIRED) gentoo-dev 2014-09-18 06:58:26 UTC
(In reply to Alex Brandt from comment #15)
> Has the status of this bug changed in the last three years?  Is the patch
> still needed to solve an issue?
> 
> If I don't hear anything by Sept 20, I'll assume this is no longer an issue
> and mark it invalid.

it is valid for different old gcc.
Comment 18 Justin Lecher (RETIRED) gentoo-dev 2014-09-18 08:26:22 UTC
(In reply to Justin Lecher from comment #17)
> (In reply to Alex Brandt from comment #15)
> > Has the status of this bug changed in the last three years?  Is the patch
> > still needed to solve an issue?
> > 
> > If I don't hear anything by Sept 20, I'll assume this is no longer an issue
> > and mark it invalid.
> 
> it is valid for different old gcc.

Bug #372377 comment #7 fixes the issue for me
Comment 19 Andrew Savchenko gentoo-dev 2014-09-18 19:56:13 UTC
ATM I use gcc-4.8.3 and I'm able to compile gcc-3.4.6-r2 successfully. I no longer use gcc:4.4.
Comment 20 Andrew Savchenko gentoo-dev 2014-09-18 20:00:17 UTC
(In reply to Alex Brandt from comment #15)
> Has the status of this bug changed in the last three years?  Is the patch
> still needed to solve an issue?
> 
> If I don't hear anything by Sept 20, I'll assume this is no longer an issue
> and mark it invalid.

Though I'd like to mention one point. Statement "if you will not test it, I'll mark it as invalid" is both offensive and invalid itself. If developer needs user's feedback either NEEDINFO or TEST-REQUEST status should be used (for this and similar cases TEST-REQUEST looks like a better choice).
Comment 21 Alex Brandt (RETIRED) gentoo-dev 2014-10-25 20:39:23 UTC
Hey Andrew,

Am I understanding your last comment correctly?  I understand your comment to mean the issue has been resolved and we can potentially mark this bug as solved.  If not, could you please let me know what action might get this issue moving forward again?

Thanks!
Comment 22 Andrew Savchenko gentoo-dev 2014-10-26 00:55:55 UTC
Hi Alex,

the issue has been solved for gcc:4.8.

But gcc:4.4 is still in tree and people may use it. I had not tested gcc-4.4.7, so I'm not sure that this issue is closed. Anyway it will not affect most of users, because use case when old gcc version (4.4.7) is being used to build even older one (3.4.6-r2) is quite odd.
Comment 23 Justin Lecher (RETIRED) gentoo-dev 2014-10-26 13:12:14 UTC
Created attachment 387450 [details]
build.log gcc:4.1 using gcc:4.9

I cannot build gcc:4.1 with gcc:4.0
Comment 24 SpanKY gentoo-dev 2014-11-16 17:40:58 UTC
*** Bug 529500 has been marked as a duplicate of this bug. ***
Comment 25 Dyweni 2015-01-14 03:20:32 UTC
Hi,

Just thought I'd add that gcc-3.4.6-r2 will only compile with gcc-4.8.3 if I disable the NLS use flag.

With the NLS use flag enabled, msgfmt (from gettext-0.18.3.2) errors out with this message:

msgfmt: /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/build/gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/libstdc++.so.6)

Thanks,
Dyweni
Comment 26 Anthony Basile gentoo-dev 2015-02-10 21:01:22 UTC
(In reply to Justin Lecher from comment #18)
> (In reply to Justin Lecher from comment #17)
> > 
> > it is valid for different old gcc.
> 
> Bug #372377 comment #7 fixes the issue for me


(In reply to Justin Lecher from comment #23)
> Created attachment 387450 [details]
> build.log gcc:4.1 using gcc:4.9
> 
> I cannot build gcc:4.1 with gcc:4.0


There are two related but distinct issues going on here.  Both occur because the system libstdc++.so.6 (found at /usr/lib/gcc/<tuple>/<current-gcc-version>/libstdc++.so.6) is linking against the instance of libgcc_s.so just built as part of the current build process of gcc (found at /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/build/gcc/libgcc_s.so.1 in this example).  This is not the system libgcc_s.so.1 which is found at /usr/lib/gcc/<tuple>/<current-gcc-version>/libgcc_s.so.1.  Because system libstdc++.so.6 is newer than the currently built libgcc_s.so.1, it doesn't find the correction symbol versioning in libgcc_s.so and craps out.

The patch in Bug #372377 comment #7 deals with msgfmt hitting this as it consumes the system libstdc++.so.6.  Here the problem is due to cc1 consuming libstdc++.so.6.  The same trick of unsetting  LD_LIBRARY_PATH may work here too.  The effect of unsetting LD_LIBRARY_PATH is to have the system libstdc++.so.6 link against the system libgcc_s.so.1 which had better work else you have a seriously broken system.

Note: above <current-gcc-version> can be chosen by gcc-config.
Comment 27 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2016-06-12 04:25:46 UTC
Needed an ancient GCC to compile some 16-year-old C-Code. 

Was impossible to build GCC 3.4.6 with GCC 5.3.0 with USE="-* ntpl"

GCC 4.1.2 however does build with GCC 5.3.0 with USE="-* ntpl"

And GCC 3.4.6 builds with GCC 4.1.2
Comment 28 SpanKY gentoo-dev 2016-11-14 14:38:07 UTC
*** Bug 599330 has been marked as a duplicate of this bug. ***
Comment 29 Andreas K. Hüttel archtester gentoo-dev 2017-08-13 09:59:39 UTC
EUNSUPPORTED
Comment 30 Larry the Git Cow gentoo-dev 2022-10-01 04:24:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6fb906ef2da01327d64cea263887ef34c97c1bbf

commit 6fb906ef2da01327d64cea263887ef34c97c1bbf
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2022-09-18 07:15:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-30 00:13:22 +0000

    10.3.0: backport glibc 2.36, gettext/msgfmt patch from 10.4.0
    
    Bug: https://bugs.gentoo.org/295480
    Bug: https://bugs.gentoo.org/372377
    Bug: https://bugs.gentoo.org/843119
    Bug: https://bugs.gentoo.org/864717
    Bug: https://bugs.gentoo.org/865879
    Closes: https://github.com/gentoo/gcc-patches/pull/2
    Signed-off-by: Sam James <sam@gentoo.org>

 10.3.0/gentoo/36_all_msgfmt-libstdc++-link.patch | 39 ++++++++++++++
 10.3.0/gentoo/37_all_glibc_236.patch             | 68 ++++++++++++++++++++++++
 10.3.0/gentoo/README.history                     |  4 ++
 3 files changed, 111 insertions(+)