diff mbox series

[meta-oe] Fix function inline errors in debug optimization

Message ID 20230801225139.3011215-1-nicolas.marguet@windriver.com
State New
Headers show
Series [meta-oe] Fix function inline errors in debug optimization | expand

Commit Message

Nicolas Marguet Aug. 1, 2023, 10:51 p.m. UTC
From: Nicolas Marguet <nicolas.marguet@windriver.com>

Compiler does not inline any functions when using debug optimization (-Og).
Hence, remove -Winline flag when compiling with debug optimization.

Backport upstream fix: https://github.com/rsyslog/librelp/pull/258
Remove previous local fix: https://github.com/rsyslog/librelp/issues/256

Upstream-Status: Backport [https://github.com/rsyslog/librelp/commit/6d575d9]

Signed-off-by: Nicolas Marguet <nicolas.marguet@windriver.com>
---
 ...line-errors-in-debug-optimization-Og.patch | 29 +++++++++++++++++++
 .../rsyslog/librelp_1.11.0.bb                 |  5 +---
 2 files changed, 30 insertions(+), 4 deletions(-)
 create mode 100644 meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch

Comments

Khem Raj Aug. 2, 2023, 3:24 a.m. UTC | #1
On Tue, Aug 1, 2023 at 3:52 PM nicolas.marguet via
lists.openembedded.org
<nicolas.marguet=windriver.com@lists.openembedded.org> wrote:
>
> From: Nicolas Marguet <nicolas.marguet@windriver.com>
>
> Compiler does not inline any functions when using debug optimization (-Og).
> Hence, remove -Winline flag when compiling with debug optimization.
>
> Backport upstream fix: https://github.com/rsyslog/librelp/pull/258
> Remove previous local fix: https://github.com/rsyslog/librelp/issues/256
>
> Upstream-Status: Backport [https://github.com/rsyslog/librelp/commit/6d575d9]

Upstream-Status: should be added to .patch file header [1]

[1] https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status

>
> Signed-off-by: Nicolas Marguet <nicolas.marguet@windriver.com>
> ---
>  ...line-errors-in-debug-optimization-Og.patch | 29 +++++++++++++++++++
>  .../rsyslog/librelp_1.11.0.bb                 |  5 +---
>  2 files changed, 30 insertions(+), 4 deletions(-)
>  create mode 100644 meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
>
> diff --git a/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch b/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
> new file mode 100644
> index 000000000..509bfbf8a
> --- /dev/null
> +++ b/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
> @@ -0,0 +1,29 @@
> +From 6d575d98565ce3119a14359eecb11ccdff92a303 Mon Sep 17 00:00:00 2001
> +From: Yash Shinde <53660251+Yashinde145@users.noreply.github.com>
> +Date: Thu, 29 Jun 2023 18:10:15 +0530
> +Subject: [PATCH] Fix function inline errors in debug optimization (-Og)
> +
> +Compiler does not inline any functions when using debug optimization (-Og). Hence, remove -Winline flag when compiling with debug optimization.
> +---
> + configure.ac | 6 ++++++
> + 1 file changed, 6 insertions(+)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 21c1fde..1204c4e 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -230,6 +230,12 @@ if test "$enable_debug" = "no"; then
> +         AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
> + fi
> +
> ++#Compiler does not inline any functions when not optimizing(-Og).
> ++#Hence, remove -Winline flag when DEBUG is enabled.
> ++#ifdef DEBUG
> ++WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Winline//g)"
> ++#endif
> ++
> + # valgrind
> + AC_ARG_ENABLE(valgrind,
> +         [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])],
> +--
> +2.39.0
> diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
> index e7b79ad03..bac5abb05 100644
> --- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
> +++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
> @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
>  DEPENDS = "gmp nettle libidn zlib gnutls openssl"
>
>  SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
> +           file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \
>  "
>
>  SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
> @@ -14,7 +15,3 @@ SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
>  S = "${WORKDIR}/git"
>
>  inherit autotools pkgconfig
> -
> -DEBUG_OPTIMIZATION:append = " -Wno-error=inline"
> -
> -
> --
> 2.39.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#104199): https://lists.openembedded.org/g/openembedded-devel/message/104199
> Mute This Topic: https://lists.openembedded.org/mt/100494901/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch b/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
new file mode 100644
index 000000000..509bfbf8a
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch
@@ -0,0 +1,29 @@ 
+From 6d575d98565ce3119a14359eecb11ccdff92a303 Mon Sep 17 00:00:00 2001
+From: Yash Shinde <53660251+Yashinde145@users.noreply.github.com>
+Date: Thu, 29 Jun 2023 18:10:15 +0530
+Subject: [PATCH] Fix function inline errors in debug optimization (-Og)
+
+Compiler does not inline any functions when using debug optimization (-Og). Hence, remove -Winline flag when compiling with debug optimization.
+---
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 21c1fde..1204c4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -230,6 +230,12 @@ if test "$enable_debug" = "no"; then
+         AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
+ fi
+
++#Compiler does not inline any functions when not optimizing(-Og).
++#Hence, remove -Winline flag when DEBUG is enabled.
++#ifdef DEBUG
++WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Winline//g)"
++#endif
++
+ # valgrind
+ AC_ARG_ENABLE(valgrind,
+         [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])],
+--
+2.39.0
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
index e7b79ad03..bac5abb05 100644
--- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb
@@ -7,6 +7,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
 DEPENDS = "gmp nettle libidn zlib gnutls openssl"
 
 SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
+           file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \
 "
 
 SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
@@ -14,7 +15,3 @@  SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
 S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig
-
-DEBUG_OPTIMIZATION:append = " -Wno-error=inline"
-
-