From 7e665feae66f8f88c1f9fc888897e5d686d516f1 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 6 Oct 2025 22:57:15 +0200 Subject: [PATCH] libexpr: make .debug_gdb_scripts aligned This avoids mangling debug gdb scripts and breaking them resulting in no script loading at all. Change-Id: Ib5e7034c37a1e41d1a1c9bd8442b8b8b8758e350 Signed-off-by: Raito Bezarius --- lix/libexpr/eval.cc | 2 +- lix/libexpr/value.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index 6f358e00b..c577c6bd0 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -46,7 +46,7 @@ // Ignore all internal signals boehm uses for parallel marking // FIXME: Find out how to do this with LLDB for macOS! #ifndef __APPLE__ -[[gnu::section(".debug_gdb_scripts"), gnu::used]] +[[gnu::section(".debug_gdb_scripts"), gnu::used, gnu::aligned(1)]] // TODO: We should use `SECTION_SCRIPT_ID_PYTHON_TEXT` from // `` instead of hardcoding 4. // But why isn't this header exported by GDB? diff --git a/lix/libexpr/value.cc b/lix/libexpr/value.cc index 06cf106fb..10d38863a 100644 --- a/lix/libexpr/value.cc +++ b/lix/libexpr/value.cc @@ -82,7 +82,7 @@ void Value::mkPath(const SourcePath & path) } #ifndef __APPLE__ -[[gnu::section(".debug_gdb_scripts"), gnu::used]] +[[gnu::section(".debug_gdb_scripts"), gnu::used, gnu::aligned(1)]] static const char printer_script[] = "\4" R"(lix-value-printer