configure: run rte_vhost gcc check explicitly with -Werror

We check rte_vhost version by trying to compile a program
using a public rte_vhost API function. We only compile the
program - without linking it - because rte_vhost has
a number of dependencies on other libs and we want to keep
the configure script simple. However, the function could
be still implicitly declared by the compiler, making the
compilation succeed when it should not.

To fix it, compile that test program with -Werror.

Change-Id: I0f187dfec909f7cd5cacb7b7a2fc21f5816c4632
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457778
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-06-12 12:28:32 +02:00 committed by Ben Walker
parent 9e3d841d3e
commit b18f19d8a7

3
configure vendored
View File

@ -376,7 +376,8 @@ if [ -z "${CONFIG[ENV]}" ]; then
# program, just compile it
if ! echo -e '#include <rte_vhost.h>\n' \
'int main(void) { return rte_vhost_extern_callback_register(0, NULL, NULL); }\n' \
| $BUILD_CMD -c -Wno-deprecated-declarations -I"${CONFIG[DPDK_DIR]}/include" -; then
| $BUILD_CMD -c -Wno-deprecated-declarations -Werror \
-I"${CONFIG[DPDK_DIR]}/include" -; then
echo "Notice: DPDK's rte_vhost not found or version < 19.05, using internal," \
"legacy rte_vhost library."
CONFIG[VHOST_INTERNAL_LIB]=y