From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D4004139694 for ; Thu, 27 Apr 2017 02:09:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 56982E0C75; Thu, 27 Apr 2017 02:09:03 +0000 (UTC) Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.181]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 13A70E0C38 for ; Thu, 27 Apr 2017 02:09:02 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BbBwB4UQFZ//vbbkFcHgYMg1UiP4EMiHSFf5BXKgGVQIIPLIVyBAIChClAGAECAQEBAQEBAWsohRYBBAE6HCgLCyETEg8FJTeKEwgOrh6LIQEBCAImhWFzgV6DGoJ7hRiCMQWBWpt2AYIThQWDMYg1gmSIFBmGWpQnHziBB3IIh0wkNQEBAQGIcQEBAQ X-IPAS-Result: A0BbBwB4UQFZ//vbbkFcHgYMg1UiP4EMiHSFf5BXKgGVQIIPLIVyBAIChClAGAECAQEBAQEBAWsohRYBBAE6HCgLCyETEg8FJTeKEwgOrh6LIQEBCAImhWFzgV6DGoJ7hRiCMQWBWpt2AYIThQWDMYg1gmSIFBmGWpQnHziBB3IIh0wkNQEBAQGIcQEBAQ X-IronPort-AV: E=Sophos;i="5.37,256,1488862800"; d="scan'208";a="309459002" Received: from 65-110-219-251.cpe.pppoe.ca (HELO waltdnes.org) ([65.110.219.251]) by smtp.teksavvy.com with SMTP; 26 Apr 2017 22:09:00 -0400 Received: by waltdnes.org (sSMTP sendmail emulation); Wed, 26 Apr 2017 22:08:44 -0400 From: "Walter Dnes" Date: Wed, 26 Apr 2017 22:08:44 -0400 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] RFC: masking old versions of sys-devel/gcc Message-ID: <20170427020844.GA28587@waltdnes.org> References: <1492950948.19560.1.camel@gentoo.org> <1629949.a07gNpRjfP@pinacolada> <33941528.YhSZt8Px0E@pinacolada> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33941528.YhSZt8Px0E@pinacolada> User-Agent: Mutt/1.5.24 (2015-08-30) X-Archives-Salt: 5749315b-fce1-40b5-8ce7-303d5d209415 X-Archives-Hash: 5165bd342be983ec3d2dcf2ad3d64ea3 On Wed, Apr 26, 2017 at 11:32:21AM +0200, Andreas K. Huettel wrote > Except that "switching back" from gcc-5 to gcc-4 doesn't really work, > and that gcc-4 will happily use gcc-5 libraries, with unintended > consequences. It can be done, but it takes a little work. I do a contributed build for Pale Moon using gcc 4.9.4 as per the developers' specs, and I use 5.4.0 for personal builds at home. This is done on a 32-bit CoentOS 6.5 chroot, in order to use an older gtk2 (long story). The native compiler is gcc 4.7.4. I build self-contained gcc 4.9.4 and 5.4.0 environments. Example follows, with gcc-4.9.4 going into $HOME/gcc494/ ####################################################################### # # Instructions adapted from https://gcc.gnu.org/wiki/InstallingGCC wget http://ftpmirror.gnu.org/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2 tar xjf gcc-4.9.4.tar.bz2 # # To get gmp, mpc, mpfr, and isl libs # You *MUST* run this script from the top-level GCC source dir cd gcc-4.9.4 contrib/download_prerequisites export CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables" export CXXFLAGS="${CFLAGS}" export MAKEOPTS="-j4" # # You *MUST NOT* run ./configure from the toplevel GCC source dir mkdir gcc-build && cd gcc-build ../configure --prefix=$HOME/gcc494 \ --disable-multilib \ --enable-libstdcxx-threads \ --enable-libstdcxx-time \ --enable-shared \ --enable-__cxa_atexit \ --disable-libunwind-exceptions \ --disable-libada make -j4 make install ####################################################################### So far, so good, but we also need to force invocations of "gcc" to use this version. The build script sources the following commands (and other build-specific stuff) before starting the compile... ####################################################################### export GCCX_ROOT=$HOME/gcc494 export PATH=$GCCX_ROOT/bin:$PATH export MANPATH=$GCCX_ROOT/share/man:MANPATH export INFOPATH=$GCCX_ROOT/share/info:$INFOPATH export LD_LIBRARY_PATH=$GCCX_ROOT/lib:$GCCX_ROOT/lib:$LD_LIBRARY_PATH export LD_RUN_PATH=$GCCX_ROOT/lib:$GCCX_ROOT/lib:$LD_RUN_PATH export LIBRARY_PATH=$GCCX_ROOT/lib:$GCCX_ROOT/lib:$LIBRARY_PATH export INCLUDE_PATH=$GCCX_ROOT/include:$INCLUDE_PATH export CPLUS_INCLUDE_PATH=$GCCX_ROOT/include:$CPLUS_INCLUDE_PATH export C_INCLUDE_PATH=$GCCX_ROOT/include:$C_INCLUDE_PATH ####################################################################### The include script to use gcc 5.4.0 differs in only the first line... ####################################################################### export GCCX_ROOT=$HOME/gcc540 ####################################################################### Would the various "export" commands work if inserted into make.conf? Actually, would they even need the "export " portion of the declaration? -- Walter Dnes I don't run "desktop environments"; I run useful applications