From 03beec44662cb53a498a8079ad5a0ec1928094c8 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Thu, 20 Jan 2022 20:18:19 +0100 Subject: [PATCH] autobuild.sh: export CC when building with custom DPDK When buliding with build_native_dpdk() CC is not set which causes "compiler" to be set to gcc and gcc-specific cflags options are used. Meson build however is not aware of this (as CC variable is not set) and uses whatever compiler is default in the OS. In case of doing the build of freebsd this results in trying to do a clang build with gcc options, which of course fails. Signed-off-by: Karol Latecki Change-Id: I72a5919410502786c5d44fe31ce231c023df9acd Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11182 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki --- autobuild.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autobuild.sh b/autobuild.sh index 58629bf37..94e6d9445 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -59,6 +59,13 @@ function build_native_dpdk() { local compiler compiler=${CC:-gcc} + + # Export CC to be absolutely sure it's set. + # If CC was not set and we defaulted to "gcc" then we need to do the export + # so that "meson build" command a few lines below is aware of which compiler + # to use. + export CC="$compiler" + if [[ $compiler != *clang* && $compiler != *gcc* ]]; then echo "Unsupported compiler detected ($compiler), failing the test" >&2 return 1