mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-12-14 22:35:25 +01:00
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<level> [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<level>, 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 <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||
|---|---|---|
| .. | ||
| files | ||
| ndpi_3.4.bb | ||
| ntopng_4.2.bb | ||