NetBSD-Users archive

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

Re: How to compile kernel for i686 instead of i386?

On Fri, Oct 26, 2012 at 5:16 AM, Mayuresh <> wrote:
> On Thu, Oct 25, 2012 at 09:45:31PM +0200, Martin Husemann wrote:
>> On Thu, Oct 25, 2012 at 10:44:05PM +0530, Mayuresh wrote:
>> > Does the MACHINE variable affect only compiler options or anything else?
>> Nothing at all, it is just the name of the port. You can ignore it for
>> optimization purposes.
>> Check pkgsrc/devel/cpuflags and add some COPTS+= -f... to your /etc/mk.conf,
>> and something like:
>> makeoptions   COPTS="-O3 -march=... -mtune=..."
> Actually adding these to /etc/mk.conf applied them to kernel as well. So I
> did no try makeoptions.
> 1. Regarding -Os:
> -Os (Tried O3, O2, O in that order) gave me a kernel that wasn't bootable.
> (O3 didn't compile to be precise.) So removed -Os altogether.
> Shouldn't it be expected that a kernel be compilable with -O3 like
> options?
> 2. Regarding machine specific options:
> cpuflags showed me "-mfpmath=sse -msse3 -march=native
> ".
> Of these sse and native weren't supported by the compiler (the default one
> that came with 6.0 RC1).
> I tried "-march=core2" as it came closest to my architecture. Strangely
> this was not mentioned in the man page, though it worked.
> I used boot up time as test, where kernel plays major role, although the
> booting time will be a function of a number of other factors.
> On 2GHz Core2 Duo intel pocessor, the boot time remained in the range of
> 23 to 24s no matter which tuning options I chose.
> Fine tuning (removing) of kernel options brought the time down from 27s
> (of stock kernel) to the above range (i.e. kernel tuning made at least a
> small difference, though compiler options made none.).
> Tests were done with all services disabled.
> I have an arch Linux installation which boots in <10s and am wondering
> what will it take to bring NetBSD boot time any closer to that.

It's from different OSs, but make sense even here

Can't find that link now, but simply most of the time max -O2 is
recommended as anything else will most probably bring issues to you
because of bugs in gcc or other parts. I was trying CPUFLAGS on pkgsrc
and had a lot of problems with packages builded that way even that it
was just two flags for my specific CPU. Can be my motherboard in
laptop before which was replaced of course, but stuff installed binary
works fine for me and need to compile something very occasionally like
stuff which is not in ports or when doing something for wip. Regarding
system I found during years that any BSD is pretty solid when
following man build/release/development or whatever man pages and that
couple of seconds quicker boot is not worth of problems after boot
during work (except if you are learning system then it makes sense of

In the end you are working with your system and not rebooting it all
the time and measuring how quickly it's back ;-) These days your
machine is supposed to run days/weeks/months without reboot so if it
boots 30s or 10s doesn't make much sense. On Linux it becomes quite
funny like in Windows where system is up very quickly, but after login
in it's doing stuff with daemons and whatever other stuff next 30s or

> Mayuresh.

Home | Main Index | Thread Index | Old Index