Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote-tracking branch 'github/3.7/march-native' into 3.7/master

  • Loading branch information...
commit 39d1f6c893c10b96547c5a0cb8d196203bddde69 2 parents 4b1c78f + dc3e0fd
@heftig heftig authored
Showing with 16 additions and 0 deletions.
  1. +11 −0 arch/x86/Kconfig.cpu
  2. +5 −0 arch/x86/Makefile_32.cpu
View
11 arch/x86/Kconfig.cpu
@@ -298,6 +298,17 @@ config X86_GENERIC
This is really intended for distributors who need more
generic optimizations.
+config X86_MARCH_NATIVE
+ bool "Use -march=native cflag (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ Setting Y here, will result in passing the -march=native and
+ -mtune=native cflags to GCC while compiling the kernel, which
+ makes GCC check the CPU capabilities and use the best cflags
+ for your computer.
+
+ Set Y here only if you use >=gcc-4.2.0.
+
#
# Define implied options from the CPU selection here
config X86_INTERNODE_CACHE_SHIFT
View
5 arch/x86/Makefile_32.cpu
@@ -10,6 +10,9 @@ tune = $(call cc-option,-mcpu=$(1),$(2))
endif
align := $(cc-option-align)
+ifeq ($(CONFIG_X86_MARCH_NATIVE),y)
+cflags-y += -march=native
+else
cflags-$(CONFIG_M386) += -march=i386
cflags-$(CONFIG_M486) += -march=i486
cflags-$(CONFIG_M586) += -march=i586
@@ -42,6 +45,8 @@ cflags-$(CONFIG_MELAN) += -march=i486
# Geode GX1 support
cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx
cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=geode,-march=pentium-mmx)
+endif
+
# add at the end to overwrite eventual tuning options from earlier
# cpu entries
cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686))
Please sign in to comment.
Something went wrong with that request. Please try again.