diff --git a/Makefile.in b/Makefile.in index de80626a9..304ebc388 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,14 +1,15 @@ QEMU = @QEMU@ -machine accel=kvm -cpu host CROSSDIR = @CROSSDIR@ JOBS = $(shell nproc) +ARCH_OPT = @ARCH_OPT@ default: linux/arch/x86/boot/bzImage - make PATH=$(PATH):$(CROSSDIR) -C hermit - make PATH=$(PATH):$(CROSSDIR) -C hermit/tools proxy + make PATH=$(PATH):$(CROSSDIR) ARCH_OPT="$(ARCH_OPT)" -C hermit + make PATH=$(PATH):$(CROSSDIR) ARCH_OPT="$(ARCH_OPT)" -C hermit/tools proxy travis: - make PATH=$(PATH):$(CROSSDIR) -C hermit - make PATH=$(PATH):$(CROSSDIR) -C hermit/tools proxy + make PATH=$(PATH):$(CROSSDIR) ARCH_OPT="$(ARCH_OPT)" -C hermit + make PATH=$(PATH):$(CROSSDIR) ARCH_OPT="$(ARCH_OPT)" -C hermit/tools proxy all: default diff --git a/configure b/configure index f83410ccd..49cfa90e2 100755 --- a/configure +++ b/configure @@ -586,6 +586,7 @@ PACKAGE_URL='http://rwth-os.github.io/HermitCore/' ac_subst_vars='LTLIBOBJS LIBOBJS +ARCH_OPT CROSSDIR QEMU target_alias @@ -629,6 +630,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +with_mtune ' ac_precious_vars='build_alias host_alias @@ -1238,6 +1240,11 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-mtune=ARCH enable tuning for a specific architecture + Report bugs to . HermitCore home page: . _ACEOF @@ -1724,6 +1731,18 @@ cp config/linux_config linux/.config CROSSDIR=`pwd`/hermit/usr/x86/bin + +# Check whether --with-mtune was given. +if test "${with_mtune+set}" = set; then : + withval=$with_mtune; if test x"$withval" != x ; then + ARCH_OPT="-mtune=$withval -march=$withval" + fi +else + ARCH_OPT= +fi + + + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF diff --git a/configure.ac b/configure.ac index 4481ef0a2..c5aef6bf2 100644 --- a/configure.ac +++ b/configure.ac @@ -19,5 +19,14 @@ cp config/linux_config linux/.config CROSSDIR=`pwd`/hermit/usr/x86/bin AC_SUBST(CROSSDIR) +AC_ARG_WITH([mtune], + [AS_HELP_STRING([--with-mtune=ARCH], + [enable tuning for a specific architecture])], + [if test x"$withval" != x ; then + ARCH_OPT="-mtune=$withval -march=$withval" + fi], + [ARCH_OPT=]) +AC_SUBST(ARCH_OPT) + AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/hermit/Makefile b/hermit/Makefile index 0a7f625b4..1b6d74ca4 100644 --- a/hermit/Makefile +++ b/hermit/Makefile @@ -54,10 +54,10 @@ ifdef PROFILING PROFILING_CFLAGS += -DXRAY_ANNOTATE endif -CFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -march=native -mtune=native -ftree-vectorize #$(STACKPROT) -FCFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -march=native -mtune=native -ftree-vectorize -FFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -march=native -mtune=native -ftree-vectorize -CXXFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -march=native -mtune=native -ftree-vectorize +CFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -ftree-vectorize $(ARCH_OPT) #$(STACKPROT) +FCFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -ftree-vectorize $(ARCH_OPT) +FFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -ftree-vectorize $(ARCH_OPT) +CXXFLAGS_FOR_NEWLIB = -m64 -mtls-direct-seg-refs -O3 -ftree-vectorize $(ARCH_OPT) LDFLAGS_FOR_NEWLIB = NASMFLAGS_FOR_NEWLIB = -felf64 CFLAGS_FOR_TOOLS = -O2 -Wall -std=gnu99