Commit 0e79a79d authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

vm_setup: Check for compiler version while compiling QEMU



Since gcc 9.* can be used across different distribution, the old check
no longer applies. Instead of looking for ArchLinux, check the gcc's
version directly to make sure proper options are added regardless of
the distribution (.e.g. Fedora{30,31} is also shipped with gcc 9.* at
the moment).

Change-Id: Ic493f411e8d886cae9bd5e2f389cb632d7b9f98a
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2432


Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 5cdab5e2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ UPGRADE=false
INSTALL=false
CONF="librxe,iscsi,rocksdb,fio,flamegraph,tsocks,qemu,vpp,libiscsi,nvmecli,qat,refspdk"
LIBRXE_INSTALL=true
gcc_version=$(gcc -dumpversion) gcc_version=${gcc_version%%.*}

if [ $(uname -s) == "FreeBSD" ]; then
	OSID="freebsd"
@@ -263,8 +264,8 @@ function install_qemu() {
		fi

		declare -a opt_params=("--prefix=/usr/local/qemu/$SPDK_QEMU_BRANCH")
		if [ "$PACKAGEMNG" = "pacman" ]; then
			# GCC 9 on ArchLinux fails to compile Qemu due to some old warnings which were not detected by older versions.
		if ((gcc_version >= 9)); then
			# GCC 9 fails to compile Qemu due to some old warnings which were not detected by older versions.
			opt_params+=("--extra-cflags=-Wno-error=stringop-truncation -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types -Wno-error=format-truncation")
			opt_params+=("--disable-glusterfs")
		fi