From owner-freebsd-hackers@FreeBSD.ORG Wed May 20 16:17:47 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C70AB67 for ; Wed, 20 May 2015 16:17:47 +0000 (UTC) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25FB51EA6 for ; Wed, 20 May 2015 16:17:47 +0000 (UTC) Received: by iebgx4 with SMTP id gx4so43012951ieb.0 for ; Wed, 20 May 2015 09:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jdgVPmhFOraU+aGucUEB34S32gwam8LrESiSPhhK574=; b=fH41zEqWeEN0Qak0pRvb2Uk9sqZncauhPSqQrviY2IFO+QOILAwbDWWT+lpFnumMaZ ZTrMNadGQu7myOlxS6i/L0vs8omIa2vJyL3EKkUYJK7XZyQ1GqYu4oO6p0xrWtP8/KJO 1KIYQNcgXMJR/geuMqflXamkgs6OoZrxFQsHKpTHkdY+MBm/AmYjAmGwTccdYX67//2I ovBZpoVsp7+R/M9JycOpE1KIXwlIHT/F3axjEI79v8sesbthmgbn0vGruIWKEg1aJMMJ 4B5NvoxCSxKt51t6hpAyQ4JprFVa1T0TCtygd08gcbOLuLa6Wr8ENOXEXjJ0WVRNDxS1 umlA== MIME-Version: 1.0 X-Received: by 10.50.79.232 with SMTP id m8mr28886332igx.6.1432138666508; Wed, 20 May 2015 09:17:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Wed, 20 May 2015 09:17:46 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 May 2015 09:17:46 -0700 X-Google-Sender-Auth: dIvtDdYoUN4K7tZ7sQxtz6u-5_I Message-ID: Subject: Re: Trying to use clang/head and XCC From: Adrian Chadd To: NGie Cooper Cc: dave@sopwith.solgatos.com, "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2015 16:17:47 -0000 On 19 May 2015 at 17:50, NGie Cooper wrote: > On Tue, May 19, 2015 at 1:35 PM, Dave Seifert > wrote: >> sean typed: >>> No documentation of what CFLAGS are required to build and ignore warnings. >> >> Are you *sure* that ignoring those warnings is a good idea? > > The problem is that clang emits a *lot* of warnings with -Wall that > gcc doesn't, which causes failures if -Werror is enabled in the build > (annoying, but I've run into this at work...). Please see my earlier > reply about 10.0-RELEASE builds being broken on 11.0-CURRENT with > clang 3.6.0. > > Also, gcc emits different warnings because (IIRC) it analyzes code > that's been optimized whereas I believe clang does it beforehand > (please correct me if I'm wrong). I'm starting the process of finding/fixing issues that gcc-4.9.2 is finding/fixing on MIPS. It can only make things cleaner. I've also been bitten by the .. lack of clarity/sanity with how CFLAGS and such is populated. For MIPS, I discovered that: * there's stuff in kmod.*mk that sets -O and other flags, but it doesn't apply to normal kernel builds; and * the CFLAGS stuff in bsd.sys.mk is what's being paid attention to. Then we don't set the CPUTYPE stuff by default on MIPS, so I have to add CPUTYPE=mips32 or gcc-4.9.2 compiles mips1 code by default, which ends pretty hilariously in places. Fun times abound! -adrian