USE_GCC=3.2+ on a 6-CURRENT system prefers the GCC 3.2 compiler instead of the GCC 3.4 default system compiler. One often uses USE_GCC=3.2+ to enable a port to build on RELENG_4, but that does not mean a 6-CURRENT user doesn't want to use the native compiler. I also argue that the correct algorithm for USE_GCC=3.2+ is: 1. Use system compiler if it's version is allowable by the USE_GCC invocation. 2. Prefer the highest version # found already installed and allowed by the USE_GCC invocation, rather than the lowest. 3. Install the specified GCC version and use if, if no other already installed compiler meets the USE_GCC invocation.
On Mon, May 16, 2005 at 10:50:01AM -0700, David O'Brien wrote: > >Synopsis: USE_GCC=X.Y+ should prefer the stock compiler Can you show what the output of "make test-gcc" is? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
Responsible Changed From-To: freebsd-ports-bugs->edwin Mine.
Please try this patch, it works here as you described: [~/cvs/ports/games/enigma] edwin@k7>make test-gcc USE_GCC=2.7+ Port can use later versions. GCC version: 2.7 - OSVERSION from 000000 to 400012 GCC version: 2.95 (port) - OSVERSION from 400012 to 500035 GCC version: 3.1 - OSVERSION from 500035 to 500039 GCC version: 3.2 - OSVERSION from 500039 to 501103 GCC version: 3.3 (base) - OSVERSION from 501103 to 502126 GCC version: 3.4 (port) - OSVERSION from 502126 to 999999 GCC version: 4.0 - OSVERSION from 999999 to 999999 GCC version: 4.1 - OSVERSION from 999999 to 999999 Using GCC vesion 3.3 CC:cc - CXX:c++ - F77: - BUILD_DEPENDS:/usr/local/lib/libzipios.a:/usr/ports/archivers/zipios++ /usr/local/bin/tolua:/usr/ports/lang/tolua4 /usr/local/bin/sdl11-config:/usr/ports/devel/sdl12 gmake:/usr/ports/devel/gmake Index: bsd.gcc.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.gcc.mk,v retrieving revision 1.2 diff -u -r1.2 bsd.gcc.mk --- bsd.gcc.mk 21 May 2005 11:34:43 -0000 1.2 +++ bsd.gcc.mk 22 May 2005 04:36:02 -0000 @@ -99,14 +99,23 @@ # # If the GCC package defined in USE_GCC does not exist, but a later # version is allowed (for example 3.1+), see if there is a later. -# The first available version will be used. +# First check if the base installed version is good enough, otherwise +# get the first available version. # .if defined(_GCC_ORLATER) . for v in ${GCCVERSIONS} . if ${_USE_GCC} == ${_GCCVERSION_${v}_V} -_GCC_MIN:= true +_GCC_MIN1:= true . endif -. if defined(_GCC_MIN) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND) +. if defined(_GCC_MIN1) && defined(_GCC_FOUND${v}) && ${_GCC_FOUND${v}}=="base" && !defined(_GCC_FOUND) +_GCC_FOUND:= ${_GCCVERSION_${v}_V} +. endif +. endfor +. for v in ${GCCVERSIONS} +. if ${_USE_GCC} == ${_GCCVERSION_${v}_V} +_GCC_MIN2:= true +. endif +. if defined(_GCC_MIN2) && defined(_GCC_FOUND${v}) && !defined(_GCC_FOUND) _GCC_FOUND:= ${_GCCVERSION_${v}_V} . endif . endfor -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
State Changed From-To: open->feedback Patch submitted, please test
Can you tell me if the submitted patch did what you have in mind? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
----- Forwarded message from Edwin Groothuis <edwin@mavetju.org> ----- Date: Fri, 27 May 2005 19:43:40 +1000 From: Edwin Groothuis <edwin@mavetju.org> To: David O'Brien <obrien@FreeBSD.org> Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: ports/81116: USE_GCC=X.Y+ should prefer the stock compiler Can you tell me if the submitted patch did what you have in mind? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/ ----- End forwarded message ----- -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
----- Forwarded message from Edwin Groothuis <edwin@mavetju.org> ----- Date: Mon, 30 May 2005 11:19:35 +1000 From: Edwin Groothuis <edwin@mavetju.org> To: David O'Brien <obrien@FreeBSD.org> Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: [edwin@mavetju.org: Re: ports/81116: USE_GCC=X.Y+ should prefer the stock compiler] ----- Forwarded message from Edwin Groothuis <edwin@mavetju.org> ----- Date: Fri, 27 May 2005 19:43:40 +1000 From: Edwin Groothuis <edwin@mavetju.org> To: David O'Brien <obrien@FreeBSD.org> Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: ports/81116: USE_GCC=X.Y+ should prefer the stock compiler Can you tell me if the submitted patch did what you have in mind? Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/ ----- End forwarded message ----- -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/ ----- End forwarded message ----- -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
On Sun, May 22, 2005 at 02:38:37PM +1000, Edwin Groothuis wrote: > Please try this patch, it works here as you described: I tested this patch using /usr/ports/misc/bidwatcher. I had the gcc31, gcc32, gcc33 ports installed. It did exactly what I wanted it to on 6-current. Looking at the patch I'm not sure what would happen on a releng4 machine. Would gcc33 or gcc31 be used? I mostly think that the newest compiler installed should be used if the base system compiler isn't suitable. -- -- David (obrien@FreeBSD.org)
State Changed From-To: feedback->closed Commited. See the commit log for a detailed description. Thanks.