All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] ndpi: fix autoconf-2.71 compatibility
@ 2021-02-09  6:07 hongxu
  2021-02-09  6:45 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: hongxu @ 2021-02-09  6:07 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

While compiling with gcc option -D_FORTIFY_SOURCE=2 (by setting
DEBUG_BUILD = '1' in local.conf), the do_configure failed:
...
|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
...

Drop AC_LANG_WERROR to workaround the failure

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../0001-configure-drop-AC_LANG_WERROR.patch  | 29 +++++++++++++++++++
 .../recipes-support/ntopng/ndpi_3.4.bb        |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch

diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
new file mode 100644
index 000000000..b2a337ae6
--- /dev/null
+++ b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
@@ -0,0 +1,29 @@
+From f3061fbc10aab9d0edec6964449af97658a993fc Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 8 Feb 2021 19:25:52 -0800
+Subject: [PATCH] configure: drop AC_LANG_WERROR
+
+To workaround configure failure with gcc option `-D_FORTIFY_SOURCE=2'
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.seed | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.seed b/configure.seed
+index 9d1185f1..f87889ed 100644
+--- a/configure.seed
++++ b/configure.seed
+@@ -34,7 +34,6 @@ dnl>  AC_PROG_CC
+   AC_PROG_CXX
+   AC_PROG_CC_STDC
+ fi
+-AC_LANG_WERROR
+ AX_PTHREAD
+ 
+ NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
+-- 
+2.29.2
+
diff --git a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
index 1e4153779..256e2ca54 100644
--- a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
+++ b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
 SRCREV = "64929a75e0a7a60d864bd25a9fd97fdf9ac892a2"
 SRC_URI = "git://github.com/ntop/nDPI.git;branch=3.4-stable \
            file://0001-autogen.sh-not-generate-configure.patch \
+           file://0001-configure-drop-AC_LANG_WERROR.patch \
 "
 
 S = "${WORKDIR}/git"
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-networking][PATCH] ndpi: fix autoconf-2.71 compatibility
  2021-02-09  6:07 [meta-networking][PATCH] ndpi: fix autoconf-2.71 compatibility hongxu
@ 2021-02-09  6:45 ` Khem Raj
  2021-02-09  6:46   ` hongxu
  2021-02-09  8:54   ` [meta-networking][PATCH V2] " hongxu
  0 siblings, 2 replies; 4+ messages in thread
From: Khem Raj @ 2021-02-09  6:45 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: openembeded-devel

D_FORTIFY_SOURCE=2 can not be used with out a -O<level> so right fix
is to pass some opt level to compiler.

On Mon, Feb 8, 2021 at 10:07 PM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>
> While compiling with gcc option -D_FORTIFY_SOURCE=2 (by setting
> DEBUG_BUILD = '1' in local.conf), the do_configure failed:
> ...
> |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
> ...
>
> Drop AC_LANG_WERROR to workaround the failure
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  .../0001-configure-drop-AC_LANG_WERROR.patch  | 29 +++++++++++++++++++
>  .../recipes-support/ntopng/ndpi_3.4.bb        |  1 +
>  2 files changed, 30 insertions(+)
>  create mode 100644 meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
>
> diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
> new file mode 100644
> index 000000000..b2a337ae6
> --- /dev/null
> +++ b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
> @@ -0,0 +1,29 @@
> +From f3061fbc10aab9d0edec6964449af97658a993fc Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Mon, 8 Feb 2021 19:25:52 -0800
> +Subject: [PATCH] configure: drop AC_LANG_WERROR
> +
> +To workaround configure failure with gcc option `-D_FORTIFY_SOURCE=2'
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + configure.seed | 1 -
> + 1 file changed, 1 deletion(-)
> +
> +diff --git a/configure.seed b/configure.seed
> +index 9d1185f1..f87889ed 100644
> +--- a/configure.seed
> ++++ b/configure.seed
> +@@ -34,7 +34,6 @@ dnl>  AC_PROG_CC
> +   AC_PROG_CXX
> +   AC_PROG_CC_STDC
> + fi
> +-AC_LANG_WERROR
> + AX_PTHREAD
> +
> + NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
> +--
> +2.29.2
> +
> diff --git a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
> index 1e4153779..256e2ca54 100644
> --- a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
> +++ b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
> @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
>  SRCREV = "64929a75e0a7a60d864bd25a9fd97fdf9ac892a2"
>  SRC_URI = "git://github.com/ntop/nDPI.git;branch=3.4-stable \
>             file://0001-autogen.sh-not-generate-configure.patch \
> +           file://0001-configure-drop-AC_LANG_WERROR.patch \
>  "
>
>  S = "${WORKDIR}/git"
> --
> 2.29.2
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-networking][PATCH] ndpi: fix autoconf-2.71 compatibility
  2021-02-09  6:45 ` Khem Raj
@ 2021-02-09  6:46   ` hongxu
  2021-02-09  8:54   ` [meta-networking][PATCH V2] " hongxu
  1 sibling, 0 replies; 4+ messages in thread
From: hongxu @ 2021-02-09  6:46 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembeded-devel

On 2/9/21 2:45 PM, Khem Raj wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> D_FORTIFY_SOURCE=2 can not be used with out a -O<level> so right fix
> is to pass some opt level to compiler.

Copy that

//Hongxu

>
> On Mon, Feb 8, 2021 at 10:07 PM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> While compiling with gcc option -D_FORTIFY_SOURCE=2 (by setting
>> DEBUG_BUILD = '1' in local.conf), the do_configure failed:
>> ...
>> |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
>> ...
>>
>> Drop AC_LANG_WERROR to workaround the failure
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>>   .../0001-configure-drop-AC_LANG_WERROR.patch  | 29 +++++++++++++++++++
>>   .../recipes-support/ntopng/ndpi_3.4.bb        |  1 +
>>   2 files changed, 30 insertions(+)
>>   create mode 100644 meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
>>
>> diff --git a/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
>> new file mode 100644
>> index 000000000..b2a337ae6
>> --- /dev/null
>> +++ b/meta-networking/recipes-support/ntopng/files/0001-configure-drop-AC_LANG_WERROR.patch
>> @@ -0,0 +1,29 @@
>> +From f3061fbc10aab9d0edec6964449af97658a993fc Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +Date: Mon, 8 Feb 2021 19:25:52 -0800
>> +Subject: [PATCH] configure: drop AC_LANG_WERROR
>> +
>> +To workaround configure failure with gcc option `-D_FORTIFY_SOURCE=2'
>> +
>> +Upstream-Status: Inappropriate [oe specific]
>> +
>> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> +---
>> + configure.seed | 1 -
>> + 1 file changed, 1 deletion(-)
>> +
>> +diff --git a/configure.seed b/configure.seed
>> +index 9d1185f1..f87889ed 100644
>> +--- a/configure.seed
>> ++++ b/configure.seed
>> +@@ -34,7 +34,6 @@ dnl>  AC_PROG_CC
>> +   AC_PROG_CXX
>> +   AC_PROG_CC_STDC
>> + fi
>> +-AC_LANG_WERROR
>> + AX_PTHREAD
>> +
>> + NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
>> +--
>> +2.29.2
>> +
>> diff --git a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
>> index 1e4153779..256e2ca54 100644
>> --- a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
>> +++ b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
>> @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b52f2d57d10c4f7ee67a7eb9615d5d24"
>>   SRCREV = "64929a75e0a7a60d864bd25a9fd97fdf9ac892a2"
>>   SRC_URI = "git://github.com/ntop/nDPI.git;branch=3.4-stable \
>>              file://0001-autogen.sh-not-generate-configure.patch \
>> +           file://0001-configure-drop-AC_LANG_WERROR.patch \
>>   "
>>
>>   S = "${WORKDIR}/git"
>> --
>> 2.29.2
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [meta-networking][PATCH V2] ndpi: fix autoconf-2.71 compatibility
  2021-02-09  6:45 ` Khem Raj
  2021-02-09  6:46   ` hongxu
@ 2021-02-09  8:54   ` hongxu
  1 sibling, 0 replies; 4+ messages in thread
From: hongxu @ 2021-02-09  8:54 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

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>
---
 meta-networking/recipes-support/ntopng/ndpi_3.4.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta-networking/recipes-support/ntopng/ndpi_3.4.bb b/meta-networking/recipes-support/ntopng/ndpi_3.4.bb
index 1e4153779..22e4d8e9a 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
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-09  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  6:07 [meta-networking][PATCH] ndpi: fix autoconf-2.71 compatibility hongxu
2021-02-09  6:45 ` Khem Raj
2021-02-09  6:46   ` hongxu
2021-02-09  8:54   ` [meta-networking][PATCH V2] " hongxu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.