NetBSD-Users archive

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

Compiler options for NetBSD

Hello folks!

Now that I've got most of the system up and running, including a home with cgd, I wanted to play around with compiler options a bit.

These are set in /etc/mk.conf, I guess. Once again, coming from FreeBSD, this seems a bit irritating, as there the file was called make.conf. :-)

Under FreeBSD, setting CFLAGS in /etc/make.conf was not considered a bad thing. The NetBSD manpage for mk.conf says that CFLAGS should *never* be set in mk.conf, without saying where to put them instead. :-) Can someone help me out here?

Under FreeBSD, my make.conf looked something like this:

  CFLAGS+= -O2 -pipe -fno-strict-aliasing -mtune=ultrasparc
  #CFLAGS+= -mcpu=ultrasparc

  COPTFLAGS+= -O2 -pipe -mtune=ultrasparc
  #COPTFLAGS+= -mcpu=ultrasparc

The line containing the -mcpu is commented out because that often broke the build, including world and kernel. This was not a code problem but instead a problem concerning the definition of the platform. Make kept on complaining that it had no idea what plattform to compile for. :-)

I noticed that quite a few things from NetBSD are compiled with -Os, which is nearly -O2 minus a few things.

What do you guys compile with (that works)? Would it be safe to compile with the options I took from FreeBSD?

I'm using 4.99.64 and I'm looking for suggestions. :-)


Home | Main Index | Thread Index | Old Index