Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain flags in mk.conf [was Re: evbppc and alpha build breakage]



In article <20130320221521.GB446%pony.stderr.spb.ru@localhost>,
Valery Ushakov  <uwe%stderr.spb.ru@localhost> wrote:
>On Wed, Mar 20, 2013 at 20:09:26 +0000, Taylor R Campbell wrote:
>
>>    Date: Wed, 20 Mar 2013 15:06:59 -0400
>>    From: Thor Lancelot Simon <tls%panix.com@localhost>
>> 
>>    On Wed, Mar 20, 2013 at 03:21:10PM +0000, Taylor R Campbell wrote:
>>    >    CFLAGS+=     -pipe
>>    >    AFLAGS+=     -pipe
>> 
>>    Explicitly setting CFLAGS, AFLAGS, etc. like this will cause severe
>>    misbehavior.  It overrides the composition of the flags at many
>>    different points within the build and will cause unobvious lossage
>>    that is hard to debug even when it does not cause an immediate
>>    build-time explosion.  Don't ever do it.
>> 
>> So I learned!  But, for the sake of curiosity -- is there a right way
>> to use mk.conf or `build.sh -V' to insert `-pipe' or similar into the
>> toolchain?  There are umpteen zillion variables involved, and
>> share/mk/bsd.README isn't clear on who is supposed to set what.
>> 
>> My rough impression is that
>> 
>> - *FLAGS are to be set only by bsd.*.mk,
>> - *OPTS are to be set only by the Makefile, and
>> - there is nothing relevant that is allowed to be set by mk.conf.
>> 
>> Is this accurate?
>
>Except that COPTS has been broken for kernel builds since ~forever.  I
>tried to raise this issue a couple of times, but without any success.
>
>sys/conf/Makefile.kern.inc has:
>
>DEFCOPTS?=      -O2
>COPTS?=         ${DEFCOPTS}
>DBG=            # might contain unwanted -Ofoo

I suggest that we change it to read:
KERNELCOPTS?=   -02
DBG=            # might contain unwanted -Ofoo

christos



Home | Main Index | Thread Index | Old Index