From 16a148f0bebdcebc5a0365a6294b21b44b5d20f0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 6 Jul 2026 16:54:21 +0300 Subject: [PATCH] Replace __WORDSIZE with __SIZEOF_POINTER__ __WORDSIZE has been relocated from bits/reg.h (now an empty header) to sys/reg.h in 2024: https://git.musl-libc.org/cgit/musl/commit/?id=e709a6f07ade208ba513f9225222336f30c304b0 And in any case, it's a private definition. Let's use a common documented define instead: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html Fixes symbol resolution on musl (particularly, postmarketOS aarch64). --- public/client/TracyElf.hpp | 15 +++++---------- public/libbacktrace/config.h | 7 +------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/public/client/TracyElf.hpp b/public/client/TracyElf.hpp index 43a88650..1e2a3011 100644 --- a/public/client/TracyElf.hpp +++ b/public/client/TracyElf.hpp @@ -3,11 +3,6 @@ #include -#if !defined(__GLIBC__) && !defined(__WORDSIZE) -// include __WORDSIZE headers for musl -# include -#endif - namespace tracy { @@ -15,14 +10,14 @@ using elf_half = uint16_t; using elf_word = uint32_t; using elf_sword = int32_t; -#if __WORDSIZE == 32 - using elf_addr = uint32_t; - using elf_off = uint32_t; - using elf_xword = uint32_t; -#else +#if __SIZEOF_POINTER__ == 8 using elf_addr = uint64_t; using elf_off = uint64_t; using elf_xword = uint64_t; +#else + using elf_addr = uint32_t; + using elf_off = uint32_t; + using elf_xword = uint32_t; #endif struct elf_ehdr diff --git a/public/libbacktrace/config.h b/public/libbacktrace/config.h index 87e38a95..c33e2731 100644 --- a/public/libbacktrace/config.h +++ b/public/libbacktrace/config.h @@ -1,9 +1,4 @@ -#include -#if defined(__linux__) && !defined(__GLIBC__) && !defined(__WORDSIZE) -// include __WORDSIZE headers for musl -# include -#endif -#if __WORDSIZE == 64 +#if __SIZEOF_POINTER__ == 8 # define BACKTRACE_ELF_SIZE 64 #else # define BACKTRACE_ELF_SIZE 32