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