From 62d04a446b75dbd96153e882dfbbea2807842dea Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 25 Jul 2026 19:18:04 +0300 Subject: [PATCH] fix(settings): stop packed struct emitting a misaligned relocation persist.strftime_format is a char* at an unaligned offset inside a __attribute__((packed)) struct. Initialising it with a string literal made the compiler emit an R_ARM_ABS32 relocation at a non-word-aligned image offset (0x78d7). The PebbleOS app loader requires relocation targets to be word-aligned and rejects the app at load time: "Invalid app relocation target[68]" -> "invalid app in bank 6" -> "Failed to start app ", so the watchface never launched. The field is never read in C (the custom date format lives in adv_settings.custom_date_fmt), so initialise it to a null pointer. No struct layout change, so persisted settings stay compatible. Relocations drop 76 -> 75, all word-aligned; verified installing and launching on Pebble Time 2 (emery). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/settings.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/settings.c b/src/settings.c index 50877e5..13e8627 100644 --- a/src/settings.c +++ b/src/settings.c @@ -20,7 +20,11 @@ static persist s_settings = { .week_format = 0, // ISO 8601 .vibe_pat_disconnect = 2, // double vibe .vibe_pat_connect = 0, // no vibe - .strftime_format = "%Y-%m-%d", + // MUST stay a null pointer (0). This packed field sits at an unaligned offset, + // so a string literal here emits a misaligned R_ARM_ABS32 relocation that the + // app loader rejects ("Invalid app relocation target" -> app never launches). + // The custom date format lives in adv_settings.custom_date_fmt; unused in C. + .strftime_format = 0, .track_battery = 0, .theme = 1, // Functional .theme_mode = 1, // Dark (matches the pre-theme look)