Commit 4d2e26d8 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

configure: fix LTO and CROSS_PREFIX



Starting with patch 873c8748, it was not possible to configure SPDK
with LTO enabled or setting a cross compilation prefix.

detect_cc.sh was moved before the configuration options
were read from command line.
This patch fixes this behavior by reading passed options
before invoking detect_cc.sh.

Next loop that reads all options has empty handling for those,
as otherwise "Unrecognized option" condition would trigger.

Added LTO to NIGHTLY release build tests.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I21802e14c0565cb7f323bcbd805967a3c4781b46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1714


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 29252a48
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ fi

timing_enter build_release

./configure $config_params --disable-debug
./configure $config_params --disable-debug --with-lto
$MAKE ${MAKEFLAGS}
$MAKE ${MAKEFLAGS} clean

+19 −9
Original line number Diff line number Diff line
@@ -120,6 +120,20 @@ declare -A CONFIG
source $rootdir/CONFIG.sh
rm $rootdir/CONFIG.sh

for i in "$@"; do
	case "$i" in
		--cross-prefix=*)
			CONFIG[CROSS_PREFIX]="${i#*=}"
			;;
		--enable-lto)
			CONFIG[LTO]=y
			;;
		--disable-lto)
			CONFIG[LTO]=n
			;;
	esac
done

# Detect the compiler toolchain
$rootdir/scripts/detect_cc.sh --cc="$CC" --cxx="$CXX" --lto="${CONFIG[LTO]}" --ld="$LD" --cross-prefix="${CONFIG[CROSS_PREFIX]}"  > $rootdir/mk/cc.mk

@@ -177,15 +191,17 @@ for i in "$@"; do
			usage
			exit 0
			;;
		--cross-prefix=*) ;&
		--enable-lto) ;&
		--disable-lto)
			# Options handled before detecting CC.
			;;
		--prefix=*)
			CONFIG[PREFIX]="${i#*=}"
			;;
		--target-arch=*)
			CONFIG[ARCH]="${i#*=}"
			;;
		--cross-prefix=*)
			CONFIG[CROSS_PREFIX]="${i#*=}"
			;;
		--enable-debug)
			CONFIG[DEBUG]=y
			;;
@@ -222,12 +238,6 @@ for i in "$@"; do
		--disable-coverage)
			CONFIG[COVERAGE]=n
			;;
		--enable-lto)
			CONFIG[LTO]=y
			;;
		--disable-lto)
			CONFIG[LTO]=n
			;;
		--enable-pgo-capture)
			CONFIG[PGO_CAPTURE]=y
			;;