[OE-core] [PATCH 3/5] gdb: Alias rpl_stat to stat() on musl

Andre McCurdy armccurdy at gmail.com
Mon Aug 12 18:12:38 UTC 2019


On Mon, Aug 20, 2018 at 12:00 PM Khem Raj <raj.khem at gmail.com> wrote:
>
> Use CPPFLAGS instead of CFLAGS since there is C++ compiler being used for somefiles
>
> Fixes
> gdb/gdbserver/../../../gdb-8.1.1/gdb/gdbserver/../common/common-utils.c:419: undefined reference to `rpl_stat'
> | collect2: error: ld returned 1 exit status
> | make[4]: *** [Makefile:414: libinproctrace.so] Error 1
>
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
>  meta/recipes-devtools/gdb/gdb_8.1.1.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gdb/gdb_8.1.1.bb b/meta/recipes-devtools/gdb/gdb_8.1.1.bb
> index 84ab08ce93..c6eac84dd8 100644
> --- a/meta/recipes-devtools/gdb/gdb_8.1.1.bb
> +++ b/meta/recipes-devtools/gdb/gdb_8.1.1.bb
> @@ -26,4 +26,4 @@ EOF
>                 chmod +x ${WORKDIR}/python
>         fi
>  }
> -CFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday"
> +CPPFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday -Drpl_stat=stat"

rpl_stat() is a wrapper for stat, so by forcefully redefining rpl_stat
to stat you create a local stat() function which recurses
infinitely... which causes obvious runtime problems (e.g. gdbserver
crashes on startup).

Simply removing these additional CPPFLAGS fixes the runtime issues for
me (and doesn't trigger the original build failure so presumably
something has changed since the patch was originally created...).


More information about the Openembedded-core mailing list