move generic kernel build parts out of board support patches
authorFelix Fietkau <nbd@openwrt.org>
Fri, 11 Nov 2005 21:56:15 +0000 (21:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 11 Nov 2005 21:56:15 +0000 (21:56 +0000)
SVN-Revision: 2439

openwrt/target/linux/linux-2.4/patches/ar7/000-ar7_support.patch
openwrt/target/linux/linux-2.4/patches/brcm/001-bcm47xx.patch
openwrt/target/linux/linux-2.4/patches/generic/006-build_flags.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/006-extra_optimization.patch [deleted file]
openwrt/target/linux/linux-2.4/patches/generic/209-build_fixes.patch [new file with mode: 0644]
openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch [deleted file]

index d5bbe42277cbf093fbf9ec172fe2846ad228c329..c5fe2486eca1dc34d43bbce4f57614c4d2f0911f 100644 (file)
@@ -1,15 +1,3 @@
-diff -urN linux.old/Makefile linux.dev/Makefile
---- linux.old/Makefile 2005-10-21 16:43:16.316951500 +0200
-+++ linux.dev/Makefile 2005-11-10 01:10:45.771570000 +0100
-@@ -91,7 +91,7 @@
- CPPFLAGS := -D__KERNEL__ -I$(HPATH)
--CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-         -fno-strict-aliasing -fno-common
- ifndef CONFIG_FRAME_POINTER
- CFLAGS += -fomit-frame-pointer
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
 --- linux.old/arch/mips/Makefile       2005-10-21 16:43:16.316951500 +0200
 +++ linux.dev/arch/mips/Makefile       2005-11-10 01:10:45.775570250 +0100
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
 --- linux.old/arch/mips/Makefile       2005-10-21 16:43:16.316951500 +0200
 +++ linux.dev/arch/mips/Makefile       2005-11-10 01:10:45.775570250 +0100
index 8dd4e3ee107c4a74f7eaf642636368b42da2c4b5..0627df3f4ff1ed5a20125d1274d2eafc8a0bf1bb 100644 (file)
@@ -1,109 +1,7 @@
-diff -urN linux.old/Makefile linux.dev/Makefile
---- linux.old/Makefile 2005-08-26 13:41:41.689634168 +0200
-+++ linux.dev/Makefile 2005-08-26 13:44:34.233403528 +0200
-@@ -17,9 +17,9 @@
- FINDHPATH     = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
- HOSTCC        = gcc
--HOSTCFLAGS    = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-+HOSTCFLAGS    = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
--CROSS_COMPILE         =
-+CROSS_COMPILE=
- #
- # Include the make variables (CC, etc...)
-@@ -91,8 +91,10 @@
- CPPFLAGS := -D__KERNEL__ -I$(HPATH)
--CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
-+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-         -fno-strict-aliasing -fno-common
-+
-+
- ifndef CONFIG_FRAME_POINTER
- CFLAGS += -fomit-frame-pointer
- endif
-@@ -354,7 +356,7 @@
-       @rm -f .ver1
- include/linux/version.h: ./Makefile
--      @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
-+      @-expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
-         (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
-       @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
-       @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
-diff -urN linux.old/Rules.make linux.dev/Rules.make
---- linux.old/Rules.make       2005-11-07 23:12:50.538884250 +0100
-+++ linux.dev/Rules.make       2005-11-07 21:57:07.837585250 +0100
-@@ -176,7 +176,14 @@
- _modinst__: dummy
- ifneq "$(strip $(ALL_MOBJS))" ""
-       mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
--      cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
-+      #@cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
-+      for f in $(ALL_MOBJS) ; do \
-+              $(OBJCOPY) -R __ksymtab -R .comment -R .note -x \
-+              `$(NM) $$f | cut -f3- -d' ' | sed -n \
-+                      -e 's/__module_parm_\(.*\)/-K \1/p' \
-+                      -e 's/__ks..tab_\(.*\)/-K \1/p'` \
-+              $$f $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)$$f; \
-+      done
- endif
- .PHONY: modules_install
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
 --- linux.old/arch/mips/Makefile       2005-11-07 23:12:50.582887000 +0100
 +++ linux.dev/arch/mips/Makefile       2005-11-07 21:57:08.537629000 +0100
 diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
 --- linux.old/arch/mips/Makefile       2005-11-07 23:12:50.582887000 +0100
 +++ linux.dev/arch/mips/Makefile       2005-11-07 21:57:08.537629000 +0100
-@@ -46,10 +46,10 @@
- GCCFLAGS      := -I $(TOPDIR)/include/asm/gcc
- GCCFLAGS      += -G 0 -mno-abicalls -fno-pic -pipe
- GCCFLAGS      += $(call check_gcc, -finline-limit=100000,)
--LINKFLAGS     += -G 0 -static -n
--MODFLAGS      += -mlong-calls
-+LINKFLAGS     += -G 0 -static -n -nostdlib
-+MODFLAGS      += -mlong-calls -fno-common
--ifdef CONFIG_DEBUG_INFO
-+ifdef CONFIG_REMOTE_DEBUG
- GCCFLAGS      += -g
- ifdef CONFIG_SB1XXX_CORELIS
- GCCFLAGS      += -mno-sched-prolog -fno-omit-frame-pointer
-@@ -71,13 +71,13 @@
- set_gccflags = $(shell \
- while :; do \
-       cpu=$(1); isa=-$(2); \
--      for gcc_opt in -march= -mcpu=; do \
-+      for gcc_opt in -march= -mtune=; do \
-               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-                       -xc /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-       done; \
-       cpu=$(3); isa=-$(4); \
--      for gcc_opt in -march= -mcpu=; do \
-+      for gcc_opt in -march= -mtune=; do \
-               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
-                       -xc /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-@@ -92,7 +92,7 @@
- fi; \
- gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
- while :; do \
--      for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
-+      for gas_opt in -Wa,-march= -Wa,-mtune=; do \
-               $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
-                       -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
-                       break 2; \
-@@ -174,6 +174,7 @@
- endif
- AFLAGS                += $(GCCFLAGS)
-+ASFLAGS               += $(GCCFLAGS)
- CFLAGS                += $(GCCFLAGS)
- LD            += -m $(ld-emul)
-@@ -727,6 +728,19 @@
+@@ -727,6 +727,19 @@
  endif
  
  #
  endif
  
  #
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/006-build_flags.patch b/openwrt/target/linux/linux-2.4/patches/generic/006-build_flags.patch
new file mode 100644 (file)
index 0000000..207dd0b
--- /dev/null
@@ -0,0 +1,99 @@
+diff -urN linux.old/Makefile linux.dev/Makefile
+--- linux.old/Makefile 2005-08-26 13:41:41.689634168 +0200
++++ linux.dev/Makefile 2005-08-26 13:44:34.233403528 +0200
+@@ -17,9 +17,9 @@
+ FINDHPATH     = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
+ HOSTCC        = gcc
+-HOSTCFLAGS    = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS    = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
+-CROSS_COMPILE         =
++CROSS_COMPILE=
+ #
+ # Include the make variables (CC, etc...)
+@@ -89,6 +89,8 @@
+ # standard CFLAGS
+ #
++check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
++
+ CPPFLAGS := -D__KERNEL__ -I$(HPATH)
+ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
+@@ -91,8 +93,10 @@
+ CPPFLAGS := -D__KERNEL__ -I$(HPATH)
+-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
++CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
+         -fno-strict-aliasing -fno-common
++
++
+ ifndef CONFIG_FRAME_POINTER
+ CFLAGS += -fomit-frame-pointer
+ endif
+@@ -100,6 +105,12 @@
+ endif
+ AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
++CFLAGS += $(call check_gcc, -funit-at-a-time,)
++
++
++
++
++
+ #
+ # ROOT_DEV specifies the default root-device when making the image.
+ # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
+diff -urN linux.old/arch/mips/Makefile linux.dev/arch/mips/Makefile
+--- linux.old/arch/mips/Makefile       2005-11-07 23:12:50.582887000 +0100
++++ linux.dev/arch/mips/Makefile       2005-11-07 21:57:08.537629000 +0100
+@@ -46,10 +46,10 @@
+ GCCFLAGS      := -I $(TOPDIR)/include/asm/gcc
+ GCCFLAGS      += -G 0 -mno-abicalls -fno-pic -pipe
+ GCCFLAGS      += $(call check_gcc, -finline-limit=100000,)
+-LINKFLAGS     += -G 0 -static -n
+-MODFLAGS      += -mlong-calls
++LINKFLAGS     += -G 0 -static -n -nostdlib
++MODFLAGS      += -mlong-calls -fno-common
+-ifdef CONFIG_DEBUG_INFO
++ifdef CONFIG_REMOTE_DEBUG
+ GCCFLAGS      += -g
+ ifdef CONFIG_SB1XXX_CORELIS
+ GCCFLAGS      += -mno-sched-prolog -fno-omit-frame-pointer
+@@ -71,13 +71,13 @@
+ set_gccflags = $(shell \
+ while :; do \
+       cpu=$(1); isa=-$(2); \
+-      for gcc_opt in -march= -mcpu=; do \
++      for gcc_opt in -march= -mtune=; do \
+               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
+                       -xc /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+       done; \
+       cpu=$(3); isa=-$(4); \
+-      for gcc_opt in -march= -mcpu=; do \
++      for gcc_opt in -march= -mtune=; do \
+               $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
+                       -xc /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+@@ -92,7 +92,7 @@
+ fi; \
+ gas_abi=-Wa,-32; gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
+ while :; do \
+-      for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
++      for gas_opt in -Wa,-march= -Wa,-mtune=; do \
+               $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
+                       -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
+                       break 2; \
+@@ -174,6 +174,7 @@
+ endif
+ AFLAGS                += $(GCCFLAGS)
++ASFLAGS               += $(GCCFLAGS)
+ CFLAGS                += $(GCCFLAGS)
+ LD            += -m $(ld-emul)
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/006-extra_optimization.patch b/openwrt/target/linux/linux-2.4/patches/generic/006-extra_optimization.patch
deleted file mode 100644 (file)
index 5ae25cb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---- linux-2.4.30/Makefile      2005-10-23 20:52:56.813948000 +0200
-+++ linux.dev/Makefile 2005-10-23 20:53:12.482927250 +0200
-@@ -89,6 +89,8 @@
- # standard CFLAGS
- #
-+check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
-+
- CPPFLAGS := -D__KERNEL__ -I$(HPATH)
- CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-@@ -100,6 +102,12 @@
- endif
- AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
-+CFLAGS += $(call check_gcc, -funit-at-a-time,)
-+
-+
-+
-+
-+
- #
- # ROOT_DEV specifies the default root-device when making the image.
- # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/209-build_fixes.patch b/openwrt/target/linux/linux-2.4/patches/generic/209-build_fixes.patch
new file mode 100644 (file)
index 0000000..1c85437
--- /dev/null
@@ -0,0 +1,48 @@
+diff -urN linux.old/Makefile linux.dev/Makefile
+--- linux.old/Makefile 2005-08-26 13:41:41.689634168 +0200
++++ linux.dev/Makefile 2005-08-26 13:44:34.233403528 +0200
+@@ -354,7 +354,7 @@
+       @rm -f .ver1
+ include/linux/version.h: ./Makefile
+-      @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
++      @-expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
+         (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false)
+       @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
+       @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
+@@ -509,7 +509,7 @@
+ ifdef CONFIG_MODVERSIONS
+       $(MAKE) update-modverfile
+ endif
+-      scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
++      find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
+       scripts/mkdep -- init/*.c > .depend
+ ifdef CONFIG_MODVERSIONS
+--- linux.old/Rules.make       2005-08-31 00:37:34.363109288 +0200
++++ linux.dev/Rules.make       2005-08-31 13:59:20.140676296 +0200
+@@ -126,7 +126,7 @@
+ # This make dependencies quickly
+ #
+ fastdep: dummy
+-      $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- $(wildcard *.[chS]) > .depend
++      find -name '*.[chS]' | xargs $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- > .depend
+ ifdef ALL_SUB_DIRS
+       $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
+ endif
+@@ -176,7 +176,14 @@
+ _modinst__: dummy
+ ifneq "$(strip $(ALL_MOBJS))" ""
+       mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
+-      cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
++      #@cp $(sort $(ALL_MOBJS)) $(MODLIB)/kernel/$(MOD_DESTDIR)
++      for f in $(ALL_MOBJS) ; do \
++              $(OBJCOPY) -R __ksymtab -R .comment -R .note -x \
++              `$(NM) $$f | cut -f3- -d' ' | sed -n \
++                      -e 's/__module_parm_\(.*\)/-K \1/p' \
++                      -e 's/__ks..tab_\(.*\)/-K \1/p'` \
++              $$f $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)$$f; \
++      done
+ endif
+ .PHONY: modules_install
diff --git a/openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch b/openwrt/target/linux/linux-2.4/patches/generic/209-mkdep_fix.patch
deleted file mode 100644 (file)
index a43d1d2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- linux.old/Rules.make       2005-08-31 00:37:34.363109288 +0200
-+++ linux.dev/Rules.make       2005-08-31 13:59:20.140676296 +0200
-@@ -126,7 +126,7 @@
- # This make dependencies quickly
- #
- fastdep: dummy
--      $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- $(wildcard *.[chS]) > .depend
-+      find -name '*.[chS]' | xargs $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- > .depend
- ifdef ALL_SUB_DIRS
-       $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
- endif
---- linux-2.4.30/Makefile.old  2005-11-11 14:27:55.878482250 +0100
-+++ linux-2.4.30/Makefile      2005-11-11 14:28:57.926360000 +0100
-@@ -509,7 +509,7 @@
- ifdef CONFIG_MODVERSIONS
-       $(MAKE) update-modverfile
- endif
--      scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
-+      find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep -- > .hdepend
-       scripts/mkdep -- init/*.c > .depend
- ifdef CONFIG_MODVERSIONS