From: Kyle Moffett <mrmacman_g4@mac.com>
To: Andi Kleen <ak@suse.de>
Cc: Adrian Bunk <bunk@stusta.de>,
linux-kernel@vger.kernel.org,
Roman Zippel <zippel@linux-m68k.org>
Subject: Re: [2.6 patch] re-add -ffreestanding
Date: Mon, 21 Aug 2006 23:37:31 -0400 [thread overview]
Message-ID: <C1CE9D4F-FBE2-4C4B-BCE9-49DF817E790C@mac.com> (raw)
In-Reply-To: <20060822011320.a3491337.ak@suse.de>
On Aug 21, 2006, at 19:13:20, Andi Kleen wrote:
>> What's the problem with adding -ffreestanding and stating
>> explicitely which functions we want to be handled be builtins, and
>> which functions we don't want to be handled by builtins?
>
> Take a look at lib/string.c and think about it a bit.
So why can't lib/string.c explicitly say __builtin_foo() instead of
foo() where we mean the former? Here's a brief summary:
With -ffreestanding:
__builtin_foo(): Use the GCC built-in if possible, otherwise out-
of-line
foo(): Always use the out-of-line function
Without -ffreestanding:
__builtin_foo(): Use the GCC built-in if possible, otherwise out-
of-line
foo(): Use the GCC built-in if possible, otherwise out-
of-line
What's wrong with always specifying -ffreestanding and using
__builtin_foo() instead of foo() where applicable? That's what it
was designed for, according to the GCC manual:
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/C-Dialect-Options.html#C-
Dialect-Options
If you want to unconditionally force a certain function to use the
GCC built-in on a particular architecture, you could always just do
this to get exactly the same result as without -ffreestanding:
#define memcpy(dest, src, len) __builtin_strcpy((dest), (src), (len))
#define memcmp(a, b, len) __builtin_strcmp((a), (b), (len))
[...]
Just stuff those types of defines in an x86-64 specific header
somewhere and turn on -ffreestanding unconditionally; you'll fix all
of the problems with MIPS, etc, without even changing the semantics
on x86-64.
Cheers,
Kyle Moffett
next prev parent reply other threads:[~2006-08-22 3:37 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-21 21:21 Adrian Bunk
2006-08-21 21:24 ` Andi Kleen
2006-08-21 21:46 ` Adrian Bunk
2006-08-21 22:09 ` Andi Kleen
2006-08-21 22:24 ` Adrian Bunk
2006-08-21 22:27 ` Andi Kleen
2006-08-21 22:58 ` Adrian Bunk
2006-08-21 23:13 ` Andi Kleen
2006-08-22 3:37 ` Kyle Moffett [this message]
2006-08-22 10:37 ` Andi Kleen
2006-08-22 11:18 ` Adrian Bunk
2006-08-21 23:33 ` Roman Zippel
2006-08-30 17:57 Adrian Bunk
2006-08-30 18:13 ` Andi Kleen
2006-08-30 18:39 ` Russell King
2006-09-06 22:37 ` Adrian Bunk
2006-09-06 23:38 ` Roman Zippel
2006-09-06 23:50 ` Adrian Bunk
2006-09-07 0:05 ` Roman Zippel
2006-09-07 0:37 ` Adrian Bunk
2006-09-07 0:47 ` Roman Zippel
2006-09-07 1:02 ` Adrian Bunk
2006-09-07 1:23 ` Roman Zippel
2006-09-07 2:23 ` Adrian Bunk
2006-09-07 10:25 ` Roman Zippel
2006-09-07 6:30 ` Russell King
2006-09-07 10:27 ` Adrian Bunk
2006-09-07 11:40 ` Roman Zippel
2006-09-07 11:43 ` Russell King
2006-09-07 14:03 ` Kyle Moffett
2006-09-07 14:25 ` Russell King
2006-09-07 14:29 ` Roman Zippel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C1CE9D4F-FBE2-4C4B-BCE9-49DF817E790C@mac.com \
--to=mrmacman_g4@mac.com \
--cc=ak@suse.de \
--cc=bunk@stusta.de \
--cc=linux-kernel@vger.kernel.org \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®