Files
Angelo Compagnucci e3095fe471 package/libabseil-cpp: allow building with musl
libabseil-cpp depends on BR2_TOOLCHAIN_HAS_UCONTEXT, which is not set
for musl, as it doesn't provide the {get,make,set}context functions.

However, absl/debugging/internal/examine_stack.cc only uses the ucontext
data structures, to get the program counter from the signal context,
and never calls those functions. musl provides those data structures,
so allow building with musl.

On 32-bit powerpc, examine_stack.cc assumes the glibc layout of
mcontext_t (uc_mcontext.uc_regs), which is different with musl, so keep
it disabled there.

examine_stack.cc was build-tested with the Bootlin musl toolchains for
aarch64, armv7, i686, x86-64, m68k, mips32el, powerpc64, powerpc64le,
riscv32, riscv64, s390x and sh4, and libabseil-cpp, re2, protobuf, grpc
and webrtc-audio-processing with the aarch64 and armv7 musl toolchains.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-11-01 22:28:41 +01:00

47 lines
2.0 KiB
Plaintext

# see absl/debugging/internal/examine_stack.cc for the list of
# architectures that are supported, and for which ucontext is used.
config BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
bool
default y if BR2_aarch64 || BR2_aarch64_be
default y if BR2_arm || BR2_armeb
default y if BR2_i386
default y if BR2_m68k
default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
default y if BR2_riscv
default y if BR2_s390x
default y if BR2_sh
default y if BR2_sparc || BR2_sparc64
default y if BR2_x86_64
# Only the ucontext data structures are used, not the
# {get,make,set}context functions, so musl is supported, except
# on 32-bit powerpc, where the glibc mcontext_t layout is assumed.
depends on BR2_TOOLCHAIN_HAS_UCONTEXT || BR2_TOOLCHAIN_USES_MUSL
depends on !(BR2_powerpc && BR2_TOOLCHAIN_USES_MUSL)
# absl/base/internal/direct_mmap.h only implements DirectMmap()
# with mmap2 for the o32 ABI on MIPS, and its 64-bit fallback
# fails to build with the n32 ABI, where long is 32-bit
depends on !BR2_MIPS_NABI32
config BR2_PACKAGE_LIBABSEIL_CPP
bool "libabseil-cpp"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_10 # C++17
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on !BR2_STATIC_LIBS # uses dlfcn.h
depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
depends on BR2_USE_WCHAR
help
Abseil is an open-source collection of C++ library code
designed to augment the C++ standard library. The Abseil
library code is collected from Google's own C++ code base,
has been extensively tested and used in production, and is
the same code we depend on in our daily coding lives.
https://github.com/abseil/abseil-cpp
comment "libabseil-cpp needs a toolchain w/ wchar, gcc >= 10, C++, threads, dynamic library"
depends on BR2_PACKAGE_LIBABSEIL_CPP_ARCH_SUPPORTS
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
BR2_STATIC_LIBS || !BR2_TOOLCHAIN_GCC_AT_LEAST_10 || !BR2_USE_WCHAR