Advertisement
Guest User

march.patch

a guest
Sep 3rd, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.14 KB | None | 0 0
  1. From ef130e812f80a1eeb8e30d4a4f17e769e30f8277 Mon Sep 17 00:00:00 2001
  2. From: Filipo Tardim <filipotardim@gmail.com>
  3. Date: Mon, 14 Mar 2011 04:55:01 +0100
  4. Subject: March: cflags -march=native
  5.  
  6. Signed-off-by: Filipo Tardim <filipotardim@gmail.com>
  7.  
  8. diff --git a/arch/x86/Makefile b/arch/x86/Makefile
  9. index 3199b76..5905452 100644
  10. --- a/arch/x86/Makefile
  11. +++ b/arch/x86/Makefile
  12. @@ -50,14 +50,14 @@
  13. KBUILD_CFLAGS += -m64
  14.  
  15. # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
  16. - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
  17. - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
  18. + cflags-$(CONFIG_MK8) += $(call cc-option,-march=native)
  19. + cflags-$(CONFIG_MPSC) += $(call cc-option,-march=native)
  20.  
  21. cflags-$(CONFIG_MCORE2) += \
  22. - $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
  23. - cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
  24. - $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
  25. - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
  26. + $(call cc-option,-march=native,$(call cc-option,-mtune=generic))
  27. + cflags-$(CONFIG_MATOM) += $(call cc-option,-march=native) \
  28. + $(call cc-option,-mtune=generic,$(call cc-option,-mtune=generic))
  29. + cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
  30. KBUILD_CFLAGS += $(cflags-y)
  31.  
  32. KBUILD_CFLAGS += -mno-red-zone
  33. diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
  34. index 3199b76..5905452 100644
  35. --- a/arch/x86/Makefile_32.cpu
  36. +++ b/arch/x86/Makefile_32.cpu
  37. @@ -2,7 +2,7 @@
  38. # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML.
  39.  
  40. #-mtune exists since gcc 3.4
  41. -HAS_MTUNE := $(call cc-option-yn, -mtune=i386)
  42. +HAS_MTUNE := $(call cc-option-yn, -mtune=generic)
  43. ifeq ($(HAS_MTUNE),y)
  44. tune = $(call cc-option,-mtune=$(1),$(2))
  45. else
  46. @@ -10,38 +10,38 @@
  47. endif
  48.  
  49. align := $(cc-option-align)
  50. -cflags-$(CONFIG_M386) += -march=i386
  51. -cflags-$(CONFIG_M486) += -march=i486
  52. -cflags-$(CONFIG_M586) += -march=i586
  53. -cflags-$(CONFIG_M586TSC) += -march=i586
  54. -cflags-$(CONFIG_M586MMX) += -march=pentium-mmx
  55. -cflags-$(CONFIG_M686) += -march=i686
  56. -cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call tune,pentium2)
  57. -cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call tune,pentium3)
  58. -cflags-$(CONFIG_MPENTIUMM) += -march=i686 $(call tune,pentium3)
  59. -cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call tune,pentium4)
  60. -cflags-$(CONFIG_MK6) += -march=k6
  61. +cflags-$(CONFIG_M386) += -march=native
  62. +cflags-$(CONFIG_M486) += -march=native
  63. +cflags-$(CONFIG_M586) += -march=native
  64. +cflags-$(CONFIG_M586TSC) += -march=native
  65. +cflags-$(CONFIG_M586MMX) += -march=native
  66. +cflags-$(CONFIG_M686) += -march=native
  67. +cflags-$(CONFIG_MPENTIUMII) += -march=native $(call tune,pentium2)
  68. +cflags-$(CONFIG_MPENTIUMIII) += -march=native $(call tune,pentium3)
  69. +cflags-$(CONFIG_MPENTIUMM) += -march=native $(call tune,pentium3)
  70. +cflags-$(CONFIG_MPENTIUM4) += -march=native $(call tune,pentium4)
  71. +cflags-$(CONFIG_MK6) += -march=native
  72. # Please note, that patches that add -march=athlon-xp and friends are pointless.
  73. # They make zero difference whatsosever to performance at this time.
  74. -cflags-$(CONFIG_MK7) += -march=athlon
  75. -cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
  76. -cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  77. -cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  78. -cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
  79. -cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
  80. -cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  81. -cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
  82. -cflags-$(CONFIG_MVIAC7) += -march=i686
  83. -cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
  84. -cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686)) \
  85. - $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
  86. +cflags-$(CONFIG_MK7) += -march=native
  87. +cflags-$(CONFIG_MK8) += $(call cc-option,-march=native,-march=native)
  88. +cflags-$(CONFIG_MCRUSOE) += -march=native $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  89. +cflags-$(CONFIG_MEFFICEON) += -march=native $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  90. +cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=native,-march=native)
  91. +cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=native,-march=native)
  92. +cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=native,-march=native) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  93. +cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=native,-march=native)
  94. +cflags-$(CONFIG_MVIAC7) += -march=native
  95. +cflags-$(CONFIG_MCORE2) += -march=native $(call tune,core2)
  96. +cflags-$(CONFIG_MATOM) += $(call cc-option,-march=native,$(call cc-option,-march=native,-march=native)) \
  97. + $(call cc-option,-mtune=generic,$(call cc-option,-mtune=generic))
  98.  
  99. # AMD Elan support
  100. -cflags-$(CONFIG_X86_ELAN) += -march=i486
  101. +cflags-$(CONFIG_X86_ELAN) += -march=native
  102.  
  103. # Geode GX1 support
  104. -cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx
  105. -cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=geode,-march=pentium-mmx)
  106. +cflags-$(CONFIG_MGEODEGX1) += -march=native
  107. +cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=native,-march=native)
  108. # add at the end to overwrite eventual tuning options from earlier
  109. # cpu entries
  110. cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686))
  111. diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
  112. index 3199b76..5905452 100644
  113. --- a/arch/x86/boot/Makefile
  114. +++ b/arch/x86/boot/Makefile
  115. @@ -60,7 +60,7 @@
  116. KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
  117. -DDISABLE_BRANCH_PROFILING \
  118. -Wall -Wstrict-prototypes \
  119. - -march=i386 -mregparm=3 \
  120. + -march=native -mregparm=3 \
  121. -include $(srctree)/$(src)/code16gcc.h \
  122. -fno-strict-aliasing -fomit-frame-pointer \
  123. $(call cc-option, -ffreestanding) \
  124. diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
  125. index 3199b76..5905452 100644
  126. --- a/arch/x86/boot/compressed/Makefile
  127. +++ b/arch/x86/boot/compressed/Makefile
  128. @@ -9,7 +9,7 @@
  129. KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
  130. KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
  131. KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
  132. -cflags-$(CONFIG_X86_32) := -march=i386
  133. +cflags-$(CONFIG_X86_32) := -march=native
  134. cflags-$(CONFIG_X86_64) := -mcmodel=small
  135. KBUILD_CFLAGS += $(cflags-y)
  136. KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
  137. diff --git a/arch/x86/kernel/acpi/realmode/Makefile b/arch/x86/kernel/acpi/realmode/Makefile
  138. index 3199b76..5905452 100644
  139. --- a/arch/x86/kernel/acpi/realmode/Makefile
  140. +++ b/arch/x86/kernel/acpi/realmode/Makefile
  141. @@ -32,7 +32,7 @@
  142. -I$(srctree)/$(bootsrc) \
  143. $(cflags-y) \
  144. -Wall -Wstrict-prototypes \
  145. - -march=i386 -mregparm=3 \
  146. + -march=native -mregparm=3 \
  147. -include $(srctree)/$(bootsrc)/code16gcc.h \
  148. -fno-strict-aliasing -fomit-frame-pointer \
  149. $(call cc-option, -ffreestanding) \
  150. diff --git a/Makefile b/Makefile
  151. index 3199b76..5905452 100644
  152. --- a/Makefile
  153. +++ b/Makefile
  154. @@ -233,7 +233,7 @@
  155.  
  156. HOSTCC = gcc
  157. HOSTCXX = g++
  158. -HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
  159. +HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -march=native -ffast-math -fomit-frame-pointer -mtune=generic
  160. HOSTCXXFLAGS = -O2
  161.  
  162. # Decide whether to build built-in, modular, or both.
  163. diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
  164. index 3199b76..5905452 100644
  165. --- a/debian/scripts/misc/kernelconfig
  166. +++ b/debian/scripts/misc/kernelconfig
  167. @@ -94,7 +94,7 @@
  168.  
  169. case "$choice" in
  170. y* | Y* | "" )
  171. - make O=`pwd`/build ARCH=$kernarch menuconfig
  172. + make O=`pwd`/build ARCH=$kernarch xconfig
  173. break ;;
  174. n* | N* )
  175. break ;;
  176. --
  177. 1.7.3.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement