From 5506dc7ddbb6ed9427f160642400f40ab854d0f3 Mon Sep 17 00:00:00 2001 From: Hongxu Jia Date: Tue, 9 Feb 2021 00:54:15 -0800 Subject: ndpi: fix autoconf-2.71 compatibility While DEBUG_BUILD != 1, Yocto adds option _FORTIFY_SOURCE to CPP and CC [1], since _FORTIFY_SOURCE requires -O1 or higher, if no -O1 or higher then results in a compiler warning. The configure.ac of ndpi uses macro AC_PROG_CC to test toolchain, since CPPFLAGS does not have the option -O [1], while building with autoconf 2.71+, the toolchain test will report a warning. The configure.ac of ndpi uses macro AC_LANG_WERROR to treat the warning as error. Then it broke the build ... |configure: error: C preprocessor "i686-wrs-linux-gcc -E --sysroot=tmp-glibc/ work/core2-32-wrs-linux/ndpi/3.4-r0/recipe-sysroot -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security" fails sanity check ... The SELECTED_OPTIMIZATION contains option -O, add SELECTED_OPTIMIZATION to CPPFLAGS to could fix the issue [1] The definition of CPP and CC and XXXFLAGS in bitbake.conf [snip] export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" ... export CFLAGS = "${TARGET_CFLAGS}" TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}" ... export CPPFLAGS = "${TARGET_CPPFLAGS}" TARGET_CPPFLAGS = "" [snip] Signed-off-by: Hongxu Jia Signed-off-by: Khem Raj --- meta-networking/recipes-support/ntopng/ndpi_3.4.bb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta-networking') diff --git a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb index 1e41537799..22e4d8e9ae 100644 --- a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb +++ b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb @@ -17,6 +17,8 @@ S = "${WORKDIR}/git" inherit autotools-brokensep pkgconfig +CPPFLAGS += "${SELECTED_OPTIMIZATION}" + do_configure_prepend() { ${S}/autogen.sh } -- cgit v1.2.3-54-g00ecf