diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-01-04 05:29:33 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:29:33 -0800 |
commit | d6326c182030bcae0bb0b35d681720e23aa8a88b (patch) | |
tree | febd926ddcf7458754a1c9195d7bf7c5ca3019e8 /Makefile | |
parent | 064da5f698e77d3c68401dcdb91644a9023de446 (diff) | |
download | history-d6326c182030bcae0bb0b35d681720e23aa8a88b.tar.gz |
[PATCH] compile with -ffreestanding
For the kernel, it would be logical to use -ffreestanding. The kernel is
not a hosted environment with a standard C library.
The gcc option -ffreestanding is supported by both gcc 2.95 and 3.4, which
covers the whole range of currently supported compilers.
Regarding changes caused by this patch:
Andi Kleen reported:
Newer gcc rewrites sprintf(buf,"%s",str) to strcpy(buf,str) transparently.
This is only true with unit-at-a-time (disabled on i386 but enabled on
x86_64). The Linux kernel doesn't offer a standard C library, and such
transparent replacements of kernel functions with builtins are quite
fragile.
Even with -ffreestanding, it's still possilble to explicitely use a gcc
builtin if desired.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile index 000fbdaddf6aed..2338eecc5171fc 100644 --- a/Makefile +++ b/Makefile @@ -350,7 +350,8 @@ LINUXINCLUDE := -Iinclude \ 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 \ |