From 478f12f75e8446b5e83debc5512e93a7a5483913 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 11 Dec 2025 22:44:04 +0900 Subject: [PATCH] Remove const from buildinfo static variables The const qualifier allows compiler optimization that bypasses our indirection workaround, causing PC-relative relocations that fail on some platforms. Keep variables non-const to force data section relocations. --- esphome/core/buildinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/core/buildinfo.cpp b/esphome/core/buildinfo.cpp index 4726f789a1..28d1479240 100644 --- a/esphome/core/buildinfo.cpp +++ b/esphome/core/buildinfo.cpp @@ -23,8 +23,8 @@ namespace buildinfo { // Reference the linker symbols as uintptr_t from the *data* section to // avoid issues with pc-relative relocations on 64-bit platforms. -static const uintptr_t config_hash = (uintptr_t) &ESPHOME_CONFIG_HASH; -static const uintptr_t build_time = (uintptr_t) &ESPHOME_BUILD_TIME; +static uintptr_t config_hash = (uintptr_t) &ESPHOME_CONFIG_HASH; +static uintptr_t build_time = (uintptr_t) &ESPHOME_BUILD_TIME; const char *get_config_hash() { static char hash_str[9];