Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jun 2016 08:34:55 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Da Rock <freebsd-hackers@herveybayaustralia.com.au>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: enabling cpu "features" in custom kernel
Message-ID:  <CAOtMX2gxsTGwg8Qt8pBwXYEH2BHT80ou5uWxUDtvd9cjHBG6qA@mail.gmail.com>
In-Reply-To: <2fa5c2cb-81eb-d44a-3011-db27035e7965@herveybayaustralia.com.au>
References:  <2fa5c2cb-81eb-d44a-3011-db27035e7965@herveybayaustralia.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 16, 2016 at 6:35 AM, Da Rock
<freebsd-hackers@herveybayaustralia.com.au> wrote:
> I'm just trying to get my head around kernel building and clang.
>
> If I want to enable certain features available on my cpu which are available
> by clang, how do I enable them? As I understand it using ccflags is a no no
> (ie /etc/make.conf), so how do I go about enabling them? I seem to be
> missing something in my research here...
>
> One thing I did consider was that there might be some "include" or "option"
> somewhere that I missed, but I still can't find it. There must be something
> in the mk files or such, and I'm guessing that its due to the ability to
> build the freebsd with various workarounds for different systems - but how
> would I get around that so I can try testing something out?
>
> Cheers

What features are you talking about?  Instruction set extensions like
AES-NI and AVX2 are already enabled in all the most important places.
If you want to enable them everywhere, you can add "-march=native" to
your CFLAGS.  You can set that in either /etc/make.conf or
/etc/src.conf.  The latter only affects the FreeBSD base system.  The
former also affects ports.  The problem with using "-march" is that
your builds no longer become portable.  You won't be able to run them
on any system older than the one where they were built.

-Alan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2gxsTGwg8Qt8pBwXYEH2BHT80ou5uWxUDtvd9cjHBG6qA>