From owner-freebsd-current@FreeBSD.ORG Thu May 2 13:36:18 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E1A6878; Thu, 2 May 2013 13:36:18 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [IPv6:2607:f8b0:400c:c02::233]) by mx1.freebsd.org (Postfix) with ESMTP id B84271CBF; Thu, 2 May 2013 13:36:17 +0000 (UTC) Received: by mail-vb0-f51.google.com with SMTP id x16so437234vbf.24 for ; Thu, 02 May 2013 06:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=hH0tOZgRJ/DEmKEV9Wv8bx9xGjQozpYRONMW2btlO4A=; b=wfV4t4beDk27kdDQ7bWESkFUx8Pt9yw0HBVXukxAALeL8EfjuktdiftSYyh/i28WFp XNVTQ4oA9K/2FdLMIrcIuI9/6UDtD8NiwpHKWZMKiOOpgeyXD3N9VRyft3n4nDF4LLXy ZIDJgknXJChVTSCzDdHVLlEhvcyJUu8QOOORUYlmw2whr04Wr1PI5bnju9SSKYfr1Odw YUH7wGaki8oGeUqeEXIiQPAzmouIcGNGjwfCHc3+Uc52MR4PgIrP2XoPf4FVuRUqaqFU /MxvRMcYTjG7zgBOZYGeix72R6TglAZyStARcx8lGeLx//rhfKbI+Z2sqcel2SbSyTkm ZN2A== MIME-Version: 1.0 X-Received: by 10.221.9.70 with SMTP id ov6mr2124214vcb.72.1367501777248; Thu, 02 May 2013 06:36:17 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.203.199 with HTTP; Thu, 2 May 2013 06:36:17 -0700 (PDT) In-Reply-To: <518265B2.40704@FreeBSD.org> References: <51820AFD.1030607@freebsd.org> <518265B2.40704@FreeBSD.org> Date: Thu, 2 May 2013 15:36:17 +0200 X-Google-Sender-Auth: W33VrOC2Q79WunMdbzSuMszxHCA Message-ID: Subject: Re: Kernel build error in hwpmc with system GNU cc From: Davide Italiano To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 13:36:18 -0000 On Thu, May 2, 2013 at 3:10 PM, Dimitry Andric wrote: > On 2013-05-02 12:06, Davide Italiano wrote: >> >> On Thu, May 2, 2013 at 8:43 AM, Andrey Chernov wrote: >>> >>> cc1: warnings being treated as errors >>> /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_core.c: In function >>> 'iap_allocate_pmc': >>> /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_core.c:1935: warning: >>> 'map' may be used uninitialized in this function > > ... > >> You can find a patch attached at the end of this mail that should fix >> the problem. > > > Hm, the warning seems to be bogus. Newer versions of gcc (I tried 4.7.3 > and 4.8.1) do not warn about 'map' (though they both warn about another > variable, which is set, but not used.) > > > >> More generally speaking, why are you building -CURRENT using GCC while >> the default compiler has been clang since November 2012? >> I understand we cannot completely get rid of GCC as long as >> Tier-2/Tier-3 arch haven't full support for clang and friends, OTOH, I >> see clang default on amd64 so I guess at some point we should declare >> GCC not officially supported anymore. Putting the additional burden of >> testing on the committer because two compilers are supported at the >> same time doesn't scale really well, at least according to me. > > > Some people still prefer gcc, and while this warning is a bit annoying, > I see no problem in putting in a workaround. Using gcc for arches which Yes, for sure it's not a problem. I try to run 'make universe' when I commit change, but it's already slow on relatively recent hardware, and I just found annoying the need of rebuilding the system using two different compilers (in particular if one of them generates warning that are bogus, as happened in this case). Other than being time-expensive, the switch at runtime from clang to GCC was not so easy for me. In fact, if I try to change from clang to gcc46 and run 'make buildkernel' I get some errors like: cc1: error: unrecognized command line option '-fformat-extensions' cc1: warning: unrecognized command line option "-Wno-error-parentheses-equality" [enabled by default] cc1: warning: unrecognized command line option "-Wno-error-empty-body" [enabled by default] cc1: warning: unrecognized command line option "-Wno-error-tautological-compare" [enabled by default] *** [genassym.o] Error code 1 which disappear actually if I re-run buildworld. Maybe I'm missing something or I'm doing something wrong. But, at the end of the day, I preferred to have my lazyness winning. Actually, I don't think it worth the effort. If there's an easier way to do this, feel free to point me to it. > default to clang will most likely have to be supported for quite some > time. > > Also, if the external toolchain support ever comes off the ground, it > will probably become necessary to suppress certain warnings on an > individual basis; for example, with recent gcc versions, there are quite > a large number of "variable x set but not used" warnings, which are not > very useful, most of the time. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare