Trying to use clang/head and XCC

Adrian Chadd adrian at freebsd.org
Wed May 20 16:17:47 UTC 2015


On 19 May 2015 at 17:50, NGie Cooper <yaneurabeya at gmail.com> wrote:
> On Tue, May 19, 2015 at 1:35 PM, Dave Seifert
> <davidalanseifert at gmail.com> 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


More information about the freebsd-hackers mailing list