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]

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 <>
>    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 ` -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/ has:

DEFCOPTS?=      -O2
COPTS?=         ${DEFCOPTS}
DBG=            # might contain unwanted -Ofoo

which screws you up when you set COPTS to anything and lose that -O2.
I think port-sparc used to have a question about that every quarter,
since dropped -O2 would blow up boot loaders beyond OBP limits.


Home | Main Index | Thread Index | Old Index