From owner-freebsd-current Sat Jun 15 22:32:42 2002 Delivered-To: freebsd-current@freebsd.org Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 4400A37B407; Sat, 15 Jun 2002 22:32:36 -0700 (PDT) Received: from pool0248.cvx22-bradley.dialup.earthlink.net ([209.179.198.248] helo=mindspring.com) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #2) id 17JSeP-00007q-00; Sat, 15 Jun 2002 22:32:34 -0700 Message-ID: <3D0C22CB.A3DD0EA8@mindspring.com> Date: Sat, 15 Jun 2002 22:31:55 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: Maxime Henrion , current@FreeBSD.ORG Subject: Re: duplicate -ffreestanding in kernel build References: <20020616134100.M1933-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bruce Evans wrote: printf( ); -> pusts( ); > > That is an incredibly *fugly* "optimization". It assumes that I > > use libc, unless I have "-ffreestanding", and it assumes my > > implementation of printf vs. puts. > > This is a routine optimization. It assumes that you use a C compiler > (printf and even libc might not exist, since they might be builtins). > A non-routine optimization might involve building hardware to run the > application and emitting the 1 bit instruction to turn the hardware on. It's routine to assume that I'm going to use libc?!? I understand the -fnobuiltins thing... particularly if the compiler generates code that makes a function call, instead of generating the code inline, and saving the call/return (kind of makes you want -fnobuiltins by default, though, since "I'm smarter than the compiler writers" is a common base assumption). I *really* don't understand them making assumptions about the instrumentation that I may or may not have put between myself and the libc implementations of functions, though. Historically, for code portability, I used to carry around my own printf(), and I didn't even have a puts(); this "optimization" would *really* break things. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message