[kernel] generic-2.4: refresh patches
[openwrt/svn-archive/archive.git] / target / linux / generic-2.4 / patches / 050-build_flags.patch
1 --- a/arch/mips/Makefile
2 +++ b/arch/mips/Makefile
3 @@ -44,10 +44,10 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
4 GCCFLAGS := -I $(TOPDIR)/include/asm/gcc
5 GCCFLAGS += -G 0 -mno-abicalls -fno-pic -pipe
6 GCCFLAGS += $(call check_gcc, -finline-limit=100000,)
7 -LINKFLAGS += -G 0 -static -n
8 -MODFLAGS += -mlong-calls
9 +LINKFLAGS += -G 0 -static -n -nostdlib
10 +MODFLAGS += -mlong-calls -fno-common
11
12 -ifdef CONFIG_DEBUG_INFO
13 +ifdef CONFIG_REMOTE_DEBUG
14 GCCFLAGS += -g
15 ifdef CONFIG_SB1XXX_CORELIS
16 GCCFLAGS += -mno-sched-prolog -fno-omit-frame-pointer
17 @@ -69,13 +69,13 @@ endif
18 set_gccflags = $(shell \
19 while :; do \
20 cpu=$(1); isa=-$(2); \
21 - for gcc_opt in -march= -mcpu=; do \
22 + for gcc_opt in -march= -mtune=; do \
23 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
24 -xc /dev/null > /dev/null 2>&1 && \
25 break 2; \
26 done; \
27 cpu=$(3); isa=-$(4); \
28 - for gcc_opt in -march= -mcpu=; do \
29 + for gcc_opt in -march= -mtune=; do \
30 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
31 -xc /dev/null > /dev/null 2>&1 && \
32 break 2; \
33 @@ -90,7 +90,7 @@ else \
34 fi; \
35 gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
36 while :; do \
37 - for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
38 + for gas_opt in -Wa,-march= -Wa,-mtune=; do \
39 $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
40 -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
41 break 2; \
42 @@ -172,6 +172,7 @@ endif
43 endif
44
45 AFLAGS += $(GCCFLAGS)
46 +ASFLAGS += $(GCCFLAGS)
47 CFLAGS += $(GCCFLAGS)
48
49 LD += -m $(ld-emul)
50 --- a/Makefile
51 +++ b/Makefile
52 @@ -17,7 +17,7 @@ HPATH = $(TOPDIR)/include
53 FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
54
55 HOSTCC = gcc
56 -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
57 +HOSTCFLAGS = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
58
59 CROSS_COMPILE =
60
61 @@ -88,10 +88,9 @@ export MODLIB
62 #
63 # standard CFLAGS
64 #
65 -
66 CPPFLAGS := -D__KERNEL__ -I$(HPATH)
67
68 -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
69 +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
70 -fno-strict-aliasing -fno-common
71 CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf
72 ifndef CONFIG_FRAME_POINTER
73 @@ -105,6 +104,8 @@ if_gcc4 = $(shell if echo __GNUC__ | $(C
74 # disable pointer signedness warnings in gcc 4.0
75 CFLAGS += $(call check_gcc,-Wno-pointer-sign,)
76
77 +CFLAGS += $(call check_gcc, -funit-at-a-time,)
78 +
79 #
80 # ROOT_DEV specifies the default root-device when making the image.
81 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case