From 6d9819258cde9ff5579242fad41c50503dde08fd Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Mar 2024 12:06:09 -0700 Subject: [PATCH] gtk4: Compile with gcc for musl/x86_64 There is a gir generation error when compiled with clang | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/recipe-sysroot/usr/include/glib-2.0/gobject/gobject.h:822: syntax error, unexpected INTEGER, expecting identifier in ' do { if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 9); if ((weak_pointer) == ((void*)0)) G_PASTE (_g_boolean_var_, 9) = 1; else G_PASTE (_g_boolean_var_, 9) = 0; G_PASTE (_ g_boolean_var_, 9); }), 1)) ; else g_assertion_message (((gchar*) 0), "/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/recipe-sysroot/usr/include/glib-2.0/gobject/gobject.h ", 822, ((const char*) (__func__)), "'" "weak_pointer" "' should be NULL"); } while (0);' at '9' | /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/recipe-sysroot/usr/include/glib-2.0/gobject/gobject.h:822: syntax error, unexpected ')', expecting identifier or '(' in ' do { if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 9); if ((weak_pointer) == ((void*)0)) G_PASTE (_g_boolean_var_, 9) = 1; else G_PASTE (_g_boolean_var_, 9) = 0; G_PASTE (_g_boolean_var_, 9); }), 1)) ; else g_assertion_message (((gchar*) 0), "/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/recipe-sysroot/usr/include/glib-2.0/gobject/gobjec t.h", 822, ((const char*) (__func__)), "'" "weak_pointer" "' should be NULL"); } while (0);' at ')' | Error relocating /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 | Error relocating /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 | Error relocating /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 | If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help. | (typically like this: GIR_EXTRA_LIBS_PATH="${B}/something/.libs" ) Signed-off-by: Khem Raj --- conf/nonclangable.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index e48816185..af38ae7d2 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -1,6 +1,10 @@ # https://github.com/llvm/llvm-project/issues/78337 TOOLCHAIN:pn-kernel-selftest = "gcc" +# x86_64/musl build fails with +# gtk4/4.12.5/build/gtk/libgtk-4.so.1: unsupported relocation type 37 +TOOLCHAIN:pn-gtk4:libc-musl:x86-64 = "gcc" + TOOLCHAIN:pn-cpufrequtils = "gcc" TOOLCHAIN:pn-grub:genericx86-64 = "gcc"