rsyslog / librelp

OFFICIAL librelp repository on github
https://www.rsyslog.com/librelp/
GNU General Public License v3.0
30 stars 35 forks source link

inline errors in debug build (1.11.0 #256

Closed rwmacleod closed 1 year ago

rwmacleod commented 1 year ago

In a Yocto (cross-compile) build, using gcc-12.2, when building with DEBUG_OPTIMIZATION, I see:

../../git/src/relpsess.c:95:1: error: inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining 
[-Werror=inline]
   95 | relpSessFreePermittedPeers(relpSess_t *const pThis)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/src/relpsess.c:1036:9: note: called from here
 1036 |         relpSessFreePermittedPeers(pThis);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Adding the following: DEBUG_OPTIMIZATION:append = " -Wno-error=inline" works around the compile failure and rsyslog passes it's tests as you'd hope.

Using the git tree and: make -C src librelp_la-relpsess.lo CFLAGS=" -Winline -Werror -Og " I was not able to reproduce the error when compiling natively using Ubuntu-22.04 (gcc-11.3) but was able to reproduce it using Fedora-37, gcc --version : gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)

Oh and it only happens when using -Og not -O[0-3]

I suspect that this is a toolchain bug rather than a librelp bug. Do you agree?

rwmacleod commented 1 year ago

Fixed by: http://cgit.openembedded.org/meta-openembedded/commit/meta-oe/recipes-extended/rsyslog?id=16e1555f6cd40255ce06680e2f7ba7a2dfce959b