From 120e4b5a5d5332024866348baa1d81809222f782 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Mon, 25 Oct 2021 15:12:42 +0200 Subject: [PATCH] src/main.cc: Fix inline assembly syntax error on ARM ARM uses @ as a comment character, so %progbits must be used in place of @progbits here. This change fixes the build on armv7 FreeBSD 13.0. Fixes mawww/kakoune/issues#4385 See also https://bugs.freebsd.org/259434 --- src/main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index 011c35b0..dab271b4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1249,8 +1249,12 @@ int main(int argc, char* argv[]) } #if defined(__ELF__) -asm(R"( -.pushsection ".debug_gdb_scripts", "MS",@progbits,1 +#ifdef __arm__ +# define PROGBITS "%progbits" +#else +# define PROGBITS "@progbits" +#endif +asm(".pushsection \".debug_gdb_scripts\", \"MS\"," PROGBITS ",1" R"( .byte 4 .ascii "kakoune-inline-gdb.py\n" .ascii "import os.path\n"