Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Jun 2016 18:23:52 +1000
From:      Da Rock <freebsd-hackers@herveybayaustralia.com.au>
To:        freebsd-hackers@freebsd.org
Subject:   Re: enabling cpu "features" in custom kernel
Message-ID:  <a6ab957a-ea5b-6a55-b7ed-2b7ed496128a@herveybayaustralia.com.au>
In-Reply-To: <CAOtMX2gxsTGwg8Qt8pBwXYEH2BHT80ou5uWxUDtvd9cjHBG6qA@mail.gmail.com>
References:  <2fa5c2cb-81eb-d44a-3011-db27035e7965@herveybayaustralia.com.au> <CAOtMX2gxsTGwg8Qt8pBwXYEH2BHT80ou5uWxUDtvd9cjHBG6qA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 17/06/2016 00:34, Alan Somers wrote:
> 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.
My question relates to what actually enables them? Is it autodetected or 
is it actually set deep in the make system somewhere?

If it is set, then where?

As far as I could tell in my research -march=native would only read what 
is already set in the config, as in amd64 or i486 - nothing different. 
Portability is not the issue here either. I want to know if some 
processor with a new exotic feature that clang recognises can be set 
during a kernel build and how. Everything seems rather "blackbox" and I 
would like to know how to be able to get past that like when I found out 
using TRY_BROKEN in ports for testing.
>
> -Alan
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a6ab957a-ea5b-6a55-b7ed-2b7ed496128a>