[meta-oe][PATCH v2] librelp: fix function inline errors in debug build


Yash Shinde
 

With DEBUG_BUILD = "1", the following errors occur:

src/relpsess.c:95:1: error:
inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]

src/tcp.c:146:1: error:
inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]

src/tcp.c:158:1: error:
inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]

Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function.
Add "__attribute__((always_inline))" to avoid these function inline errors.

Also revert the work-around made earlier in librelp_1.11.0.bb.

Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256

Signed-off-by: Yash Shinde <Yash.Shinde@...>
---
...01-librelp-fix-function-inline-error.patch | 58 +++++++++++++++++++
.../rsyslog/librelp_1.11.0.bb | 2 +-
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch

diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
new file mode 100644
index 000000000..523a8991f
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
@@ -0,0 +1,58 @@
+From dc841f01fb6167ec9a80e373c5f4d2f5e3222ed6 Mon Sep 17 00:00:00 2001
+From: Yash Shinde <Yash.Shinde@...>
+Date: Tue, 28 Mar 2023 04:06:58 +0000
+Subject: librelp: fix function inline errors in debug build
+
+With DEBUG_BUILD = "1", the following errors occur:
+
+ src/relpsess.c:95:1: error:
+ inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+ src/tcp.c:146:1: error:
+ inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+ src/tcp.c:158:1: error:
+ inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]
+
+Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function. Add "__attribute__((always_inline))" to avoid these function inline errors.
+
+Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
+
+Signed-off-by: Yash Shinde <Yash.Shinde@...>
+---
+
+diff --git a/src/relpsess.c b/src/relpsess.c
+index ee7b595..aa52b71 100644
+--- a/src/relpsess.c
++++ b/src/relpsess.c
+@@ -91,7 +91,7 @@ callOnErr(const relpSess_t *__restrict__ const pThis,
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpSessFreePermittedPeers(relpSess_t *const pThis)
+ {
+ int i;
+diff --git a/src/tcp.c b/src/tcp.c
+index 7a75cc4..f4088c0 100644
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -142,7 +142,7 @@ static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ {
+ int i;
+@@ -154,7 +154,7 @@ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ }
+
+ /* helper to call onAuthErr if set */
+-static inline void
++__attribute__((always_inline)) static inline void
+ callOnAuthErr(relpTcp_t *const pThis, const char *authdata, const char *emsg, relpRetVal ecode)
+ {
+ pThis->pEngine->dbgprint((char*)"librelp: auth error: authdata:'%s', ecode %d, "
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..a41b05a35 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-librelp-fix-function-inline-error.patch \
"

SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
@@ -15,6 +16,5 @@ S = "${WORKDIR}/git"

inherit autotools pkgconfig

-DEBUG_OPTIMIZATION:append = " -Wno-error=inline"


--
2.34.1


Randy MacLeod
 

On 2023-03-30 01:44, Yash Shinde wrote:
With DEBUG_BUILD = "1", the following errors occur:

   src/relpsess.c:95:1: error:
      inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]

   src/tcp.c:146:1: error:
      inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]

   src/tcp.c:158:1: error:
      inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]

Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function.
Add "__attribute__((always_inline))" to avoid these function inline errors.

Also revert the work-around made earlier in librelp_1.11.0.bb.

Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
This is a less instrusive work-around.

Please create a gcc bug to track the compiler regression and reply here
with the ID. As well, note the gcc bug id in the librelp issue. Once the
compiler is fixed, we can close the librelp bug.


../Randy


Signed-off-by: Yash Shinde <Yash.Shinde@...>
---
 ...01-librelp-fix-function-inline-error.patch | 58 +++++++++++++++++++
 .../rsyslog/librelp_1.11.0.bb                 |  2 +-
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch

diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
new file mode 100644
index 000000000..523a8991f
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
@@ -0,0 +1,58 @@
+From dc841f01fb6167ec9a80e373c5f4d2f5e3222ed6 Mon Sep 17 00:00:00 2001
+From: Yash Shinde <Yash.Shinde@...>
+Date: Tue, 28 Mar 2023 04:06:58 +0000
+Subject: librelp: fix function inline errors in debug build
+
+With DEBUG_BUILD = "1", the following errors occur:
+
+   src/relpsess.c:95:1: error:
+      inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+   src/tcp.c:146:1: error:
+      inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+   src/tcp.c:158:1: error:
+      inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]
+
+Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function. Add "__attribute__((always_inline))" to avoid these function inline errors.
+
+Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
+
+Signed-off-by: Yash Shinde <Yash.Shinde@...>
+---
+
+diff --git a/src/relpsess.c b/src/relpsess.c
+index ee7b595..aa52b71 100644
+--- a/src/relpsess.c
++++ b/src/relpsess.c
+@@ -91,7 +91,7 @@ callOnErr(const relpSess_t *__restrict__ const pThis,
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpSessFreePermittedPeers(relpSess_t *const pThis)
+ {
+        int i;
+diff --git a/src/tcp.c b/src/tcp.c
+index 7a75cc4..f4088c0 100644
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -142,7 +142,7 @@ static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ {
+        int i;
+@@ -154,7 +154,7 @@ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ }
+
+ /* helper to call onAuthErr if set */
+-static inline void
++__attribute__((always_inline)) static inline void
+ callOnAuthErr(relpTcp_t *const pThis, const char *authdata, const char *emsg, relpRetVal ecode)
+ {
+        pThis->pEngine->dbgprint((char*)"librelp: auth error: authdata:'%s', ecode %d, "
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..a41b05a35 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-librelp-fix-function-inline-error.patch \
 "
 
 SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
@@ -15,6 +16,5 @@ S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig
 
-DEBUG_OPTIMIZATION:append = " -Wno-error=inline"
 
 


-- 
# Randy MacLeod
# Wind River Linux


Khem Raj
 

also patch does not apply cleanly

27772 Applying patch 0001-librelp-fix-function-inline-error.patch
27773 patching file src/relpsess.c
27774 Hunk #1 succeeded at 91 with fuzz 1.
27775 patching file src/tcp.c
27776 Hunk #1 succeeded at 142 with fuzz 1.
27777 Hunk #2 succeeded at 154 with fuzz 1.

On Thu, Mar 30, 2023 at 4:29 AM Randy MacLeod
<randy.macleod@...> wrote:

On 2023-03-30 01:44, Yash Shinde wrote:

With DEBUG_BUILD = "1", the following errors occur:

src/relpsess.c:95:1: error:
inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]

src/tcp.c:146:1: error:
inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]

src/tcp.c:158:1: error:
inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]

Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function.
Add "__attribute__((always_inline))" to avoid these function inline errors.

Also revert the work-around made earlier in librelp_1.11.0.bb.

Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256

This is a less instrusive work-around.

Please create a gcc bug to track the compiler regression and reply here
with the ID. As well, note the gcc bug id in the librelp issue. Once the
compiler is fixed, we can close the librelp bug.


../Randy

Signed-off-by: Yash Shinde <Yash.Shinde@...>
---
...01-librelp-fix-function-inline-error.patch | 58 +++++++++++++++++++
.../rsyslog/librelp_1.11.0.bb | 2 +-
2 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch

diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
new file mode 100644
index 000000000..523a8991f
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
@@ -0,0 +1,58 @@
+From dc841f01fb6167ec9a80e373c5f4d2f5e3222ed6 Mon Sep 17 00:00:00 2001
+From: Yash Shinde <Yash.Shinde@...>
+Date: Tue, 28 Mar 2023 04:06:58 +0000
+Subject: librelp: fix function inline errors in debug build
+
+With DEBUG_BUILD = "1", the following errors occur:
+
+ src/relpsess.c:95:1: error:
+ inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+ src/tcp.c:146:1: error:
+ inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]
+
+ src/tcp.c:158:1: error:
+ inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]
+
+Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function. Add "__attribute__((always_inline))" to avoid these function inline errors.
+
+Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
+
+Signed-off-by: Yash Shinde <Yash.Shinde@...>
+---
+
+diff --git a/src/relpsess.c b/src/relpsess.c
+index ee7b595..aa52b71 100644
+--- a/src/relpsess.c
++++ b/src/relpsess.c
+@@ -91,7 +91,7 @@ callOnErr(const relpSess_t *__restrict__ const pThis,
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpSessFreePermittedPeers(relpSess_t *const pThis)
+ {
+ int i;
+diff --git a/src/tcp.c b/src/tcp.c
+index 7a75cc4..f4088c0 100644
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -142,7 +142,7 @@ static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
+
+
+ /* helper to free permittedPeer structure */
+-static inline void
++__attribute__((always_inline)) static inline void
+ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ {
+ int i;
+@@ -154,7 +154,7 @@ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
+ }
+
+ /* helper to call onAuthErr if set */
+-static inline void
++__attribute__((always_inline)) static inline void
+ callOnAuthErr(relpTcp_t *const pThis, const char *authdata, const char *emsg, relpRetVal ecode)
+ {
+ pThis->pEngine->dbgprint((char*)"librelp: auth error: authdata:'%s', ecode %d, "
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..a41b05a35 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-librelp-fix-function-inline-error.patch \
"

SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
@@ -15,6 +16,5 @@ S = "${WORKDIR}/git"

inherit autotools pkgconfig

-DEBUG_OPTIMIZATION:append = " -Wno-error=inline"




--
# Randy MacLeod
# Wind River Linux




Shinde, Yash
 

I did get the patch fuzz while testing and fixed it using the devtool command. I am not sure how it came back. Will check.

 

Regards,
Yash

 

From: Khem Raj
Sent: 30 March 2023 18:52
To: MacLeod, Randy
Cc: Yash Shinde; openembedded-devel@...; Kokkonda, Sundeep; Shinde, Yash
Subject: Re: [oe] [meta-oe][PATCH v2] librelp: fix function inline errors in debug build

 

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

also patch does not apply cleanly

   27772 Applying patch 0001-librelp-fix-function-inline-error.patch
   27773 patching file src/relpsess.c
   27774 Hunk #1 succeeded at 91 with fuzz 1.
   27775 patching file src/tcp.c
   27776 Hunk #1 succeeded at 142 with fuzz 1.
   27777 Hunk #2 succeeded at 154 with fuzz 1.

On Thu, Mar 30, 2023 at 4:29 AM Randy MacLeod
<randy.macleod@...> wrote:
>
> On 2023-03-30 01:44, Yash Shinde wrote:
>
> With DEBUG_BUILD = "1", the following errors occur:
>
>    src/relpsess.c:95:1: error:
>       inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]
>
>    src/tcp.c:146:1: error:
>       inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]
>
>    src/tcp.c:158:1: error:
>       inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]
>
> Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function.
> Add "__attribute__((always_inline))" to avoid these function inline errors.
>
> Also revert the work-around made earlier in librelp_1.11.0.bb.
>
> Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
>
> This is a less instrusive work-around.
>
> Please create a gcc bug to track the compiler regression and reply here
> with the ID. As well, note the gcc bug id in the librelp issue. Once the
> compiler is fixed, we can close the librelp bug.
>
>
> ../Randy
>
> Signed-off-by: Yash Shinde <Yash.Shinde@...>
> ---
>  ...01-librelp-fix-function-inline-error.patch | 58 +++++++++++++++++++
>  .../rsyslog/librelp_1.11.0.bb                 |  2 +-
>  2 files changed, 59 insertions(+), 1 deletion(-)
>  create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
>
> diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
> new file mode 100644
> index 000000000..523a8991f
> --- /dev/null
> +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-librelp-fix-function-inline-error.patch
> @@ -0,0 +1,58 @@
> +From dc841f01fb6167ec9a80e373c5f4d2f5e3222ed6 Mon Sep 17 00:00:00 2001
> +From: Yash Shinde <Yash.Shinde@...>
> +Date: Tue, 28 Mar 2023 04:06:58 +0000
> +Subject: librelp: fix function inline errors in debug build
> +
> +With DEBUG_BUILD = "1", the following errors occur:
> +
> +   src/relpsess.c:95:1: error:
> +      inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining [-Werror=inline]
> +
> +   src/tcp.c:146:1: error:
> +      inlining failed in call to 'relpTcpFreePermittedPeers': function not considered for inlining [-Werror=inline]
> +
> +   src/tcp.c:158:1: error:
> +      inlining failed in call to 'callOnAuthErr': function not considered for inlining [-Werror=inline]
> +
> +Compiler does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function. Add "__attribute__((always_inline))" to avoid these function inline errors.
> +
> +Upstream-Status: Tracked by upstream bug: https://github.com/rsyslog/librelp/issues/256
> +
> +Signed-off-by: Yash Shinde <Yash.Shinde@...>
> +---
> +
> +diff --git a/src/relpsess.c b/src/relpsess.c
> +index ee7b595..aa52b71 100644
> +--- a/src/relpsess.c
> ++++ b/src/relpsess.c
> +@@ -91,7 +91,7 @@ callOnErr(const relpSess_t *__restrict__ const pThis,
> +
> +
> + /* helper to free permittedPeer structure */
> +-static inline void
> ++__attribute__((always_inline)) static inline void
> + relpSessFreePermittedPeers(relpSess_t *const pThis)
> + {
> +        int i;
> +diff --git a/src/tcp.c b/src/tcp.c
> +index 7a75cc4..f4088c0 100644
> +--- a/src/tcp.c
> ++++ b/src/tcp.c
> +@@ -142,7 +142,7 @@ static int relpTcpChkPeerName(relpTcp_t *const pThis, void* cert);
> +
> +
> + /* helper to free permittedPeer structure */
> +-static inline void
> ++__attribute__((always_inline)) static inline void
> + relpTcpFreePermittedPeers(relpTcp_t *const pThis)
> + {
> +        int i;
> +@@ -154,7 +154,7 @@ relpTcpFreePermittedPeers(relpTcp_t *const pThis)
> + }
> +
> + /* helper to call onAuthErr if set */
> +-static inline void
> ++__attribute__((always_inline)) static inline void
> + callOnAuthErr(relpTcp_t *const pThis, const char *authdata, const char *emsg, relpRetVal ecode)
> + {
> +        pThis->pEngine->dbgprint((char*)"librelp: auth error: authdata:'%s', ecode %d, "
> 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..a41b05a35 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-librelp-fix-function-inline-error.patch \
>  "
>
>  SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
> @@ -15,6 +16,5 @@ S = "${WORKDIR}/git"
>
>  inherit autotools pkgconfig
>
> -DEBUG_OPTIMIZATION:append = " -Wno-error=inline"
>
>
>
>
> --
> # Randy MacLeod
> # Wind River Linux
>
>
>
>