[PATCH mtd-utils 4/5] configure.ac: Add a check for execinfo and backtrace
Zhihao Cheng
chengzhihao1 at huawei.com
Tue Feb 18 01:48:39 PST 2025
在 2025/2/18 8:15, Fabio Estevam 写道:
> musl relies on an extenal execinfo library to provide backtrace
> functionality.
>
> Add support for it.
>
> | /work/festevam/oe/poky/build/tmp/work/core2-64-poky-linux-musl/mtd-utils/2.3.0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/14.2.0/ld: ubifs-utils/libubifs/mkfs_ubifs-io.o: in function `dump_stack':
> | /usr/src/debug/mtd-utils/2.3.0/ubifs-utils/common/defs.h:71:(.text+0x25): undefined reference to `backtrace'
> ....
> | collect2: error: ld returned 1 exit status
> | make: *** [Makefile:2959: mkfs.ubifs] Error 1
>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>
> ---
> configure.ac | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configure.ac b/configure.ac
> index 2a79ba820fc0..65afb245d89c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -238,6 +238,7 @@ if test "x$need_cmocka" = "xyes"; then
> PKG_CHECK_MODULES(CMOCKA, [cmocka], [], [cmocka_missing="yes"])
> fi
>
> +AC_CHECK_LIB([execinfo], [backtrace])
> AC_CHECK_HEADERS([execinfo.h])
Hi Fabio,
I'm not sure which lib is depended for execinfo by musl. We don't depend
any libs for other common compilers, otherwise we could get following
messgags for doing configure:
checking for sys/random.h... yes
checking for backtrace in -lexecinfo... no # In fact backtrace is
supported, but the message tells us not.
checking execinfo.h usability... yes
checking execinfo.h presence... yes
>
> ##### produce summary on dependencies #####
>
More information about the linux-mtd
mailing list