diff options
author | Ross Burton <ross.burton@arm.com> | 2025-02-26 18:24:00 +0000 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2025-06-02 07:22:10 +0200 |
commit | 8a83b306db64d6f60186d4396b0b770163b85b6e (patch) | |
tree | d5e7b0032b59d37c8f03685aa767b44f1ed2d35e /ubifs-utils/common | |
parent | 4594fc1f4496a0ed55cabd31fbeba4e3fbf05602 (diff) |
ubifs-utils: link libmissing.a in case execinfo.h isn't present
On musl execinfo.h doesn't exist, but ubifs-utils uses backtrace() when
reporting errors. This results in build failures under musl.
Handily, libmissing.a already exists with a stub implementation of
backtrace().
Guard the execinfo.h include and if it isn't available instead include
libmissing.h, and link to libmissing.a to provide backtrace() if needed.
Signed-off-by: Ross Burton <ross.burton@arm.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/common')
-rw-r--r-- | ubifs-utils/common/defs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h index 7ff1771..d5edbf6 100644 --- a/ubifs-utils/common/defs.h +++ b/ubifs-utils/common/defs.h @@ -13,8 +13,11 @@ #include <errno.h> #include <time.h> #include <assert.h> +#if HAVE_EXECINFO_H #include <execinfo.h> - +#else +#include "libmissing.h" +#endif #include "ubifs.h" /* common.h requires the PROGRAM_NAME macro */ |