Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Aug 2002 09:53:31 +1000
From:      Duncan Anker <d.anker@au.darkbluesea.com>
To:        questions@freebsd.org
Subject:   Using gcc flag -fno-builtin in kernel compilation
Message-ID:  <3D56F8FB.1030401@au.darkbluesea.com>

next in thread | raw e-mail | index | archive | help
Hi all,

I'm curious about the use of the -fno-builtin flag with regards to 
building a FreeBSD kernel. According to the GCC man pages, the compiler 
will normally replace certain calls with inlined/optimized functions at 
the expense of being able to trace/replace those functions, makin 
smaller, faster code. Usage of the -fno-builtin flag inhibts the 
compiler from doing this, forcing it to use the standard libraries.

All well and good. However, the kernel LINT file uses -fno-builtin as an 
example for compiler flag options with the comment "Here we use it to 
inhibit use of non-optimal gcc builtin functions (e.g., memcmp)." This 
suggests that gcc's inlining is not optimal - is this the case, or does 
FreeBSD provide it's own overriding functions for these?

The short question is, should I use -fno-builtin in my kernel builds or 
not? What other flags should I pass to make the kernel more 
high-performance? I'm currently using -fomit-frame-pointer. Is this 
useful? Is it worth upping the optimization level from -O to -O2 or -O3?

Any tips people can offer would be greatly appreciated.

TIA
Duncan Anker


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D56F8FB.1030401>