Created attachment 883088 [details] build.log gui-libs/gtk-4.12.5::gentoo fails to compile on Gentoo Linux amd64 musl/llvm ``` FAILED: gtk/Gdk-4.0.gir env PKG_CONFIG_PATH=/var/tmp/portage/gui-libs/gtk-4.12.5/temp/python3.12/pkgconfig:/usr/share/pkgconfig:/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/meson-uninstalled PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig PKG_CONFIG=/usr/bin/x86_64-gentoo-linux-musl-pkg-config CC=clang /usr/bin/g-ir-scanner --quiet --no-libtool --namespace=Gdk --nsversion=4.0 --warn-all --output gtk/Gdk-4.0.gir --c-include=gdk/gdk.h -DGTK_COMPILATION --quiet -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gdk/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gdk/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gsk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gsk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gdk/x11 -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gdk/x11 -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gdk/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gdk/. --filelist=/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk/libgtk-4.so.1.1200.5.p/Gdk_4.0_gir_filelist --include=cairo-1.0 --include=Gio-2.0 --include=GdkPixbuf-2.0 --include=Pango-1.0 --include=PangoCairo-1.0 --symbol-prefix=gdk --identifier-prefix=Gdk --pkg-export=gtk4 --cflags-begin -DG_LOG_USE_STRUCTURED=1 -DGLIB_DISABLE_DEPRECATION_WARNINGS '-DGTK_VERSION="4.12.5"' -D_GNU_SOURCE -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gdk/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gdk/. -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gsk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gsk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/gdk/x11 -I/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gdk/x11 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/fribidi -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/lzo -I/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/share/gir-1.0 -L/var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk --library gtk-4 --extra-library=gmodule-2.0 --extra-library=glib-2.0 --extra-library=gobject-2.0 --extra-library=gio-2.0 --extra-library=pangocairo-1.0 --extra-library=pango-1.0 --extra-library=harfbuzz --extra-library=cairo --extra-library=fribidi --extra-library=cairo-gobject --extra-library=fontconfig --extra-library=freetype --extra-library=gdk_pixbuf-2.0 --extra-library=epoxy --extra-library=m --extra-library=graphene-1.0 --extra-library=Xi --extra-library=X11 --extra-library=pangoft2-1.0 --extra-library=png16 --extra-library=tiff --extra-library=jpeg --extra-library=xkbcommon --extra-library=wayland-client --extra-library=wayland-egl --extra-library=Xrender --extra-library=Xext --extra-library=Xcursor --extra-library=Xdamage --extra-library=Xfixes --extra-library=Xrandr --extra-library=Xinerama --extra-library=cairo-script-interpreter --extra-library=girepository-1.0 --sources-top-dirs /var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5/ --sources-top-dirs /var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/ Error relocating /var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk/libgtk-4.so.1: unsupported relocation type 37 Error relocating /var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk/libgtk-4.so.1: unsupported relocation type 37 Error relocating /var/tmp/portage/gui-libs/gtk-4.12.5/work/gtk-4.12.5-build/gtk/libgtk-4.so.1: unsupported relocation type 37 ```
Created attachment 883089 [details] emerge.info
From https://bugs.php.net/bug.php?id=76392, this seems to be caused by musl's lack of support for the ifunc attribute. There is a check for this in meson.build, but for some reason it succeeds even on musl. It only seems to be used with cpu_flags_x86_f16c, so disabling that should be a workaround. However, there's clearly a bigger issue here since __has_attribute(ifunc) should be false, but it's not. I suspect this is an LLVM 18 issue.
Looking deeper, it seems like prior to LLVM 18, that test would never pass with clang: (ifunc.c: configure check extracted from meson.build) vi@virtuoso ~/Downloads $ clang-17 -march=native ifunc.c ifunc.c:32:3: error: invalid cpu feature string for builtin 32 | __builtin_cpu_supports ("f16c"); | ^ ~~~~~~ 1 error generated. However, https://github.com/llvm/llvm-project/commit/f3a4de395c167aeb8207294222c6ff5719ef6f62 added support for f16c to __builtin_cpu_supports, so it compiles and the check succeeds now, and __has_attribute must just not support ifunc.
OP, testing with compiler pre-releases is welcome, but: 1) please note that you're doing that explicitly in a comment; 2) please try to then analyse the cause like vimproved did if possible. Thanks!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bf6edca85aae719efca3ce169d96880586f9a4c commit 7bf6edca85aae719efca3ce169d96880586f9a4c Author: Violet Purcell <vimproved@inventati.org> AuthorDate: 2024-01-25 18:29:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-02 05:28:28 +0000 profiles/features/musl: mask gui-libs/gtk[cpu_flags_x86_f16c] f16c support in gtk4 requires the ifunc attribute, which is not available on musl. There is a configure check for this, however it seems to be unreliable. Closes: https://bugs.gentoo.org/922897 Signed-off-by: Violet Purcell <vimproved@inventati.org> Closes: https://github.com/gentoo/gentoo/pull/35014 Signed-off-by: Sam James <sam@gentoo.org> profiles/features/musl/package.use.mask | 6 ++++++ 1 file changed, 6 insertions(+)