050-build_flags.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Index: linux-2.4.35.4/arch/mips/Makefile
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/arch/mips/Makefile
  4. +++ linux-2.4.35.4/arch/mips/Makefile
  5. @@ -44,10 +44,10 @@ MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
  6. GCCFLAGS := -I $(TOPDIR)/include/asm/gcc
  7. GCCFLAGS += -G 0 -mno-abicalls -fno-pic -pipe
  8. GCCFLAGS += $(call check_gcc, -finline-limit=100000,)
  9. -LINKFLAGS += -G 0 -static -n
  10. -MODFLAGS += -mlong-calls
  11. +LINKFLAGS += -G 0 -static -n -nostdlib
  12. +MODFLAGS += -mlong-calls -fno-common
  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 @@ endif
  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 @@ else \
  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 @@ endif
  44. endif
  45. AFLAGS += $(GCCFLAGS)
  46. +ASFLAGS += $(GCCFLAGS)
  47. CFLAGS += $(GCCFLAGS)
  48. LD += -m $(ld-emul)
  49. Index: linux-2.4.35.4/Makefile
  50. ===================================================================
  51. --- linux-2.4.35.4.orig/Makefile
  52. +++ linux-2.4.35.4/Makefile
  53. @@ -17,7 +17,7 @@ HPATH = $(TOPDIR)/include
  54. FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net $(HPATH)/math-emu
  55. HOSTCC = gcc
  56. -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
  57. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer
  58. CROSS_COMPILE =
  59. @@ -88,10 +88,9 @@ export MODLIB
  60. #
  61. # standard CFLAGS
  62. #
  63. -
  64. CPPFLAGS := -D__KERNEL__ -I$(HPATH)
  65. -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
  66. +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
  67. -fno-strict-aliasing -fno-common
  68. CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf
  69. ifndef CONFIG_FRAME_POINTER
  70. @@ -105,6 +104,8 @@ if_gcc4 = $(shell if echo __GNUC__ | $(C
  71. # disable pointer signedness warnings in gcc 4.0
  72. CFLAGS += $(call check_gcc,-Wno-pointer-sign,)
  73. +CFLAGS += $(call check_gcc, -funit-at-a-time,)
  74. +
  75. #
  76. # ROOT_DEV specifies the default root-device when making the image.
  77. # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case