1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

enable architecture dependent tuning only with a configure flag

This commit is contained in:
Stefan Lankes 2016-08-28 00:50:42 +02:00
parent a392afcbda
commit 7c8e642377
4 changed files with 37 additions and 8 deletions

View file

@ -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

19
configure vendored
View file

@ -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 <slankes@eonerc.rwth-aachen.de>.
HermitCore home page: <http://rwth-os.github.io/HermitCore/>.
_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

View file

@ -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

View file

@ -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