NetBSD-Bugs archive

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

toolchain/55174: has trouble with CFLAGS on /etc/mk.conf if it was used "+=" instead of "="

>Number:         55174
>Category:       toolchain
>Synopsis: has trouble with CFLAGS on /etc/mk.conf if it was used "+=" instead of "="
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 14 00:45:00 +0000 2020
>Originator:     João Paulo Vinha Bittar
>Release:        9.0
home user
NetBSD localhost 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 i386
The does not accept compiler flags lines with "+="  /etc/mk.conf, only lines with "=".

One can add, for example, "CFLAGS+=-O2" because there are instructions to use "+=" so to not get "problems with packages that need to add their own flags" (, but then it breaks which accepts only "=" on the compiler flags (in this example, it would be "CFLAGS=-O2").
1) Create the /etc/mk.conf if it does not exist and add the following line:

CFLAGS+="-O2 -pipe"

2) Run "/usr/src/ -U -O ~/OBJ -x release" (without quotes) to build NetBSD and without having root privileges.

3) Wait a little bit, so the tools are built correctly;

4) After the tools are built, the actual building of NetBSD and X suddenly stops.
The only workaround I know is to change the compiler flags on /etc/mk.conf to use only "=" instead of "+=" before running /usr/src/

It would be nice if, until is fixed, to add a warning to the NetBSD Guide, Chapter 31 (, so we know that using "+=" instead of "=" as it was told on will break the  The page at should also note that using "+=" will break  Other places, as man pages or the default output of without arguments could also warn about using only "=" on /etc/mk.conf.

Home | Main Index | Thread Index | Old Index