I've got x86_64-pc-linux-gnu-3.4.3 and x86_64-pc-linux-gnu-4.0.1-pre20050616 The default (selected) one is x86_64-pc-linux-gnu-3.4.3 If I now export the output of gcc-config -E x86_64-pc-linux-gnu-4.0.1-pre20050616 I can compile programs using 4.0.1. But despite what it says -E foobar does _NOT_ export an LD_LIBRARY_PATH. This means that I am not able to run programs compiled with 4.0.1 unless I export the correct LD_LIBRARY_PATH manually. Error when executing: ./a.out: /usr/lib/gcc/x86_64-pc-linux-gnu/ 3.4.3/libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./a.out) I've already tried recompiling gcc (3.4.3) since it's libs are used by default but it didnt help. So imho gcc-config -E should not only print an export for the path but also for the LD_LIBRARY_PATH needed to make sure we use the correct gcc's libs. Reproducible: Always Steps to Reproduce: 1. type gcc-config -E foobar 2. 3. Actual Results: printed out an export for PATH Expected Results: print out export for PATH and export for LD_LIBRARY_PATH Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3, glibc-2.3.5-r0, 2.6.12-gentoo-r2 x86_64) ================================================================= System uname: 2.6.12-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3500+ Gentoo Base System version 1.6.12 Python: dev-lang/python-2.3.5 [2.3.5 (#1, May 21 2005, 18:48:41)] dev-lang/python: 2.3.5 sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.8.5-r3, 1.5, 1.7.9-r1, 1.6.3, 1.4_p6, 1.9.5 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CFLAGS="-O2 -pipe -march=k8 -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -march=k8 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="myprivateone" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="myprivateone" USE="amd64 3dnowex X a52 aac aalib acpi acpi4linux alsa artworkextra audiofile bash-completion berkdb bitmap-fonts bluetooth cairo cdr cdrom crypt cups curl doc dvb dvd dvdr dvdread eds emoticon encode esd ethereal fam ffmpeg finger firefox flac font-server fortran ftp gdbm gif glade gnome gpm gstreamer gtk http icq imap imlib ipv6 java jp2 jpeg junit kdeenablefinal lesstif libwww lm_sensors lzo lzw lzw-tiff matroska mjpeg mozilla mp3 mpeg4 mplayer ncurses nethack network neural nls nntp nptl offensive ogg opengl oss pam perl pic plotutils png povray prelink python qt readline real screenshot shared sharedmem snmp sockets speedo ssl stencil-buffer tcpd tetex threads tiff transcode truetype truetype-fonts type1-fonts unicode usb userlocales videos vidix vim-with-x xanim xface xine xinerama xml2 xmms xpm xprint xrandr xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
You can use gcc-config -L for that.
(In reply to comment #1) > You can use gcc-config -L for that. Thanks! Still, imho gcc-config -E should either print out the environment for the libs or you should change the description text. | -E, --print-environ Print environment that can be used to setup the | current gcc profile, or a specified one. This is simply not true as I won't have a working profile without also setting the LD_LIBRARY_PATH.
that's an unrelated issue ... considering both gcc-3.4.3 and gcc-4.0.1 use the ABI # of '6', that means they should be compatible at any rate, -E and -L are doing what they're supposed to