lkml.org 
[lkml]   [2004]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] Use -ffreestanding?
On Tue, Nov 09, 2004 at 06:01:07AM +0100, Andi Kleen wrote:
> > Why doesn't the kernel use -ffreestanding which should prevent all such
> > problems?
>
> Because we want most of these optimizations. Also with -ffreestanding

Do we really want the compiler to silently replace in-kernel functions
with built-ins?

You can still do an explicit
#define strlen __builtin_strlen
if you want to use a gcc built-in function.

> you would need to supply the out of line string functions anyways
> because gcc wouldn't inline them.

At least with gcc 3.4.2 on i386 adding -ffreestanding and your
(i386-specific) IN_STRING_C hack removed compiles fine.

> -Andi


I'm open for examples why this actually doesn't work, but after my
(limited) testin I'd suggest the patch below for inclusion in the next
-mm.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.10-rc1-mm4-full-ffreestanding/Makefile.old 2004-11-09 22:27:06.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full-ffreestanding/Makefile 2004-11-09 22:27:47.000000000 +0100
@@ -349,7 +349,8 @@
CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)

CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \
- -fno-strict-aliasing -fno-common
+ -fno-strict-aliasing -fno-common \
+ -ffreestanding
AFLAGS := -D__ASSEMBLY__

export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.064 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site