From owner-freebsd-questions Sun Aug 11 16:55:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAB1637B400 for ; Sun, 11 Aug 2002 16:55:16 -0700 (PDT) Received: from mail.au.darkbluesea.com (mail.au.darkbluesea.com [203.185.208.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id A545D43E65 for ; Sun, 11 Aug 2002 16:55:15 -0700 (PDT) (envelope-from d.anker@au.darkbluesea.com) Received: (qmail 63913 invoked from network); 12 Aug 2002 00:19:06 -0000 Received: from unknown (HELO au.darkbluesea.com) (10.0.0.188) by mail.au.darkbluesea.com with SMTP; 12 Aug 2002 00:19:06 -0000 Message-ID: <3D56F8FB.1030401@au.darkbluesea.com> Date: Mon, 12 Aug 2002 09:53:31 +1000 From: Duncan Anker User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529 X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@freebsd.org Subject: Using gcc flag -fno-builtin in kernel compilation Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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