From 0e79a79df3065fc4f43458828c061f23d4664b30 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 14 May 2020 16:08:15 +0200 Subject: [PATCH] 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: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2432 Reviewed-by: Darek Stojaczyk Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- test/common/config/vm_setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/common/config/vm_setup.sh b/test/common/config/vm_setup.sh index c26167040..9747d443b 100755 --- a/test/common/config/vm_setup.sh +++ b/test/common/config/vm_setup.sh @@ -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