From nobody@FreeBSD.org  Mon Aug 27 18:49:34 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A39A81065677
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 18:49:34 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8DBD88FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 18:49:34 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7RInYvY034751
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Aug 2012 18:49:34 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q7RInYTD034750;
	Mon, 27 Aug 2012 18:49:34 GMT
	(envelope-from nobody)
Message-Id: <201208271849.q7RInYTD034750@red.freebsd.org>
Date: Mon, 27 Aug 2012 18:49:34 GMT
From: Dan McGregor <dan.mcgregor@usask.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: GCC incorrectly identified in base when CLANG_IS_CC and WITHOUT_GCC are set
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171120
>Category:       misc
>Synopsis:       GCC incorrectly identified in base when CLANG_IS_CC and WITHOUT_GCC are set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 27 18:50:11 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Dan McGregor
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD nebuchadnezzar.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r+5a7bf35: Wed Aug 22 13:23:02 CST 2012     dan@nebuchadnezzar.local:/home/dan/freebsd-obj/usr/home/dan/freebsd/sys/GENERIC  amd64
>Description:
I have both WITH_CLANG_IS_CC and WITHOUT_GCC set in /etc/src.conf, so gcc does not exist in the base system.

Any port that has USE_GCC=4.2+ set incorrectly assumes that GCC 4.2 is in base.  I think the expected behaviour should be to identify that it could be in base, then check, rather than simply taking it on faith that /usr/bin/gcc exists.
>How-To-Repeat:
Build a release WITHOUT_GCC and WITH_CLANG_IS_CC and then try to build a port with USE_GCC=4.2+ (for example audio/clementine-player).
>Fix:
wrap setting _GCCVERSION and _GCC_FOUND${v} in .if directives and remove the error condition if _GCCVERSION is undefined.

I attached a patch.

Patch attached with submission follows:

Index: bsd.gcc.mk
===================================================================
--- bsd.gcc.mk  (revision 303050)
+++ bsd.gcc.mk  (working copy)
@@ -129,13 +129,12 @@
 _GCC_FOUND${v}=	port
 . endif
 . if ${OSVERSION} >= ${_GCCVERSION_${v}_L} && ${OSVERSION} < ${_GCCVERSION_${v}_R}
+.  if exists(/usr/bin/gcc)
 _GCCVERSION:=		${v}
 _GCC_FOUND${v}:=	base
+.  endif
 . endif
 .endfor
-.if !defined(_GCCVERSION)
-IGNORE=		Couldn't find your current GCCVERSION (OSVERSION=${OSVERSION})
-.endif
 
 #
 # If the GCC package defined in USE_GCC does not exist, but a later


>Release-Note:
>Audit-Trail:
>Unformatted:
