Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 1 | From 6d575d98565ce3119a14359eecb11ccdff92a303 Mon Sep 17 00:00:00 2001 |
| 2 | From: Yash Shinde <53660251+Yashinde145@users.noreply.github.com> |
| 3 | Date: Thu, 29 Jun 2023 18:10:15 +0530 |
| 4 | Subject: [PATCH] Fix function inline errors in debug optimization (-Og) |
| 5 | |
| 6 | Compiler does not inline any functions when using debug optimization (-Og). |
| 7 | Hence, remove -Winline flag when compiling with debug optimization. |
| 8 | |
| 9 | Signed-off-by: Nicolas Marguet <nicolas.marguet@windriver.com> |
| 10 | --- |
| 11 | Upstream-Status: Backport [https://github.com/rsyslog/librelp/commit/6d575d9] |
| 12 | |
| 13 | configure.ac | 6 ++++++ |
| 14 | 1 file changed, 6 insertions(+) |
| 15 | |
| 16 | diff --git a/configure.ac b/configure.ac |
| 17 | index 21c1fde..1204c4e 100644 |
| 18 | --- a/configure.ac |
| 19 | +++ b/configure.ac |
| 20 | @@ -230,6 +230,12 @@ if test "$enable_debug" = "no"; then |
| 21 | AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.]) |
| 22 | fi |
| 23 | |
| 24 | +#Compiler does not inline any functions when not optimizing(-Og). |
| 25 | +#Hence, remove -Winline flag when DEBUG is enabled. |
| 26 | +#ifdef DEBUG |
| 27 | +WARN_CFLAGS="$(echo "$WARN_CFLAGS" | sed s/-Winline//g)" |
| 28 | +#endif |
| 29 | + |
| 30 | # valgrind |
| 31 | AC_ARG_ENABLE(valgrind, |
| 32 | [AS_HELP_STRING([--enable-valgrind],[Enable valgrind tests@<:@default=yes@:>@])], |
| 33 | -- |
| 34 | 2.39.0 |