configure: fix LTO and CROSS_PREFIX
Starting with patch 873c874
, 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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I21802e14c0565cb7f323bcbd805967a3c4781b46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1714
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
29252a483b
commit
4d2e26d888
@ -35,7 +35,7 @@ fi
|
|||||||
|
|
||||||
timing_enter build_release
|
timing_enter build_release
|
||||||
|
|
||||||
./configure $config_params --disable-debug
|
./configure $config_params --disable-debug --with-lto
|
||||||
$MAKE ${MAKEFLAGS}
|
$MAKE ${MAKEFLAGS}
|
||||||
$MAKE ${MAKEFLAGS} clean
|
$MAKE ${MAKEFLAGS} clean
|
||||||
|
|
||||||
|
28
configure
vendored
28
configure
vendored
@ -120,6 +120,20 @@ declare -A CONFIG
|
|||||||
source $rootdir/CONFIG.sh
|
source $rootdir/CONFIG.sh
|
||||||
rm $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
|
# 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
|
$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
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
--cross-prefix=*) ;&
|
||||||
|
--enable-lto) ;&
|
||||||
|
--disable-lto)
|
||||||
|
# Options handled before detecting CC.
|
||||||
|
;;
|
||||||
--prefix=*)
|
--prefix=*)
|
||||||
CONFIG[PREFIX]="${i#*=}"
|
CONFIG[PREFIX]="${i#*=}"
|
||||||
;;
|
;;
|
||||||
--target-arch=*)
|
--target-arch=*)
|
||||||
CONFIG[ARCH]="${i#*=}"
|
CONFIG[ARCH]="${i#*=}"
|
||||||
;;
|
;;
|
||||||
--cross-prefix=*)
|
|
||||||
CONFIG[CROSS_PREFIX]="${i#*=}"
|
|
||||||
;;
|
|
||||||
--enable-debug)
|
--enable-debug)
|
||||||
CONFIG[DEBUG]=y
|
CONFIG[DEBUG]=y
|
||||||
;;
|
;;
|
||||||
@ -222,12 +238,6 @@ for i in "$@"; do
|
|||||||
--disable-coverage)
|
--disable-coverage)
|
||||||
CONFIG[COVERAGE]=n
|
CONFIG[COVERAGE]=n
|
||||||
;;
|
;;
|
||||||
--enable-lto)
|
|
||||||
CONFIG[LTO]=y
|
|
||||||
;;
|
|
||||||
--disable-lto)
|
|
||||||
CONFIG[LTO]=n
|
|
||||||
;;
|
|
||||||
--enable-pgo-capture)
|
--enable-pgo-capture)
|
||||||
CONFIG[PGO_CAPTURE]=y
|
CONFIG[PGO_CAPTURE]=y
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user