From 9c7fb0bfb1392af90af5027e90426af855075af0 Mon Sep 17 00:00:00 2001 From: vasko-110 Date: Fri, 4 Sep 2026 14:14:37 +0300 Subject: [PATCH] debugging: guard ABSL_HAVE_ELF_MEM_IMAGE on availability ABSL_HAVE_ELF_MEM_IMAGE is enabled for every __ELF__ target except an explicit deny-list, and elf_mem_image.h then includes unconditionally. __ELF__ describes the object format, not the presence of a dynamic loader, and is a glibc/dynamic-linker header that bare-metal ELF toolchains do not ship. On arm-none-eabi with newlib the macro is defined, the include is reached, and the build fails with a fatal error. Test for the header the code actually needs instead of enumerating the platforms that lack it. The existing exclusions stay: __sun, __QNX__ and __OpenBSD__ do provide a , with different semantics. stacktrace_config.h in the same directory already guards on __has_include(), and __has_include has been used unconditionally since 2fb25663. --- absl/debugging/internal/elf_mem_image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/absl/debugging/internal/elf_mem_image.h b/absl/debugging/internal/elf_mem_image.h index 4d31a474cfd..26f5fd6bae7 100644 --- a/absl/debugging/internal/elf_mem_image.h +++ b/absl/debugging/internal/elf_mem_image.h @@ -36,7 +36,7 @@ #if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) && \ !defined(__asmjs__) && !defined(__wasm__) && !defined(__HAIKU__) && \ !defined(__sun) && !defined(__VXWORKS__) && !defined(__hexagon__) && \ - !defined(__XTENSA__) + !defined(__XTENSA__) && __has_include() #define ABSL_HAVE_ELF_MEM_IMAGE 1 #endif