Created attachment 856614 [details] emerge --info Builds fine with gcc-12 but fails to build with clang-15. [...] clang -DHAVE_CONFIG_H -I. -I../.. -DGIMPDIR=\""GIMP"\" -DGIMP_APP_VERSION=\"2.10\" -DGIMP_USER_VERSION=\"2.10\" -DG_LOG_DOMAIN=\"Gimp-Core\" -I../.. -I../.. -I../../app -I../../app -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/gegl-0.4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/json-glib-1.0 -pthread -I/usr/include/babl-0.1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libmypaint -I/usr/include/json-c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -DMYPAINT_BRUSHES_DIR=\"/usr/share/mypaint-data/2.0/brushes\" -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -Os -march=bdver3 -mtune=bdver3 -pipe -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes -Wstrict-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition -Wmissing-format-attribute -Wformat-security -Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type -c -o gimpbacktrace-windows.o gimpbacktrace-windows.c gimpbacktrace-linux.c:42:10: fatal error: 'execinfo.h' file not found #include <execinfo.h> ^~~~~~~~~~~~ clang -DHAVE_CONFIG_H -I. -I../.. -DGIMPDIR=\""GIMP"\" -DGIMP_APP_VERSION=\"2.10\" -DGIMP_USER_VERSION=\"2.10\" -DG_LOG_DOMAIN=\"Gimp-Core\" -I../.. -I../.. -I../../app -I../../app -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/gegl-0.4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/json-glib-1.0 -pthread -I/usr/include/babl-0.1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libmypaint -I/usr/include/json-c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -DMYPAINT_BRUSHES_DIR=\"/usr/share/mypaint-data/2.0/brushes\" -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -Os -march=bdver3 -mtune=bdver3 -pipe -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes -Wstrict-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition -Wmissing-format-attribute -Wformat-security -Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type -c -o gimpasync.o gimpasync.c 1 error generated. make[4]: *** [Makefile:1704: gimpbacktrace-linux.o] Error 1 make[4]: *** Waiting for unfinished jobs.... make[4]: Leaving directory '/var/tmp/portage/media-gfx/gimp-2.10.32-r4/work/gimp-2.10.32/app/core' make[3]: *** [Makefile:1419: all] Error 2
Created attachment 856616 [details] build.log.xz
I hacked up a patch for someone for this on IRC recently. We just need to add a __GLIBC__ guard in the file which checks for backtrace support.
Created attachment 861818 [details, diff] gimp-2.10_fix_musl_execinfo_check.patch
Created attachment 861819 [details] gimp-2.10.34-r2.ebuild
Could you please check the build for Clang + musl-1.2.3 with attached "gimp-2.10_fix_musl_execinfo_check.patch" and "gimp-2.10.34-r2.ebuild"?
Created attachment 861820 [details] build.log.xz (gimp-2.10.34-r2.ebuild) With your patch+ebuild the build continues but errors out later at linking stage: [...] libtool: link: clang -Os -march=bdver3 -mtune=bdver3 -pipe -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes -Wstrict-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition -Wmissing-format-attribute -Wformat-security -Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type -Wl,-u -Wl,gimp_vectors_undo_get_type -Wl,-u -Wl,gimp_vectors_mod_undo_get_type -Wl,-u -Wl,gimp_param_spec_duplicate -Wl,-u -Wl,gimp_operations_init -Wl,-u -Wl,xcf_init -Wl,-u -Wl,internal_procs_init -Wl,-u -Wl,gimp_plug_in_manager_restore -Wl,-u -Wl,gimp_pdb_compat_param_spec -Wl,-u -Wl,gimp_layer_mode_is_legacy -Wl,-u -Wl,gimp_parallel_init -Wl,-u -Wl,gimp_async_set_new -Wl,-u -Wl,gimp_uncancelable_waitable_new -Wl,-u -Wl,gimp_lebl_dialog -Wl,-O1 -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -o .libs/gimp-2.10 app.o errors.o language.o sanity.o signals.o tests.o unique.o gimp-debug.o gimp-log.o gimp-update.o gimp-version.o main.o -Wl,--export-dynamic -fopenmp -Wl,--as-needed gui/libappgui.a menus/libappmenus.a actions/libappactions.a dialogs/libappdialogs.a tools/libapptools.a display/libappdisplay.a propgui/libapppropgui.a widgets/libappwidgets.a ../libgimpwidgets/.libs/libgimpwidgets-2.0.so -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 xcf/libappxcf.a pdb/libappinternal-procs.a pdb/libapppdb.a plug-in/libappplug-in.a vectors/libappvectors.a core/libappcore.a file/libappfile.a file-data/libappfile-data.a text/libapptext.a paint/libapppaint.a operations/libappoperations.a operations/layer-modes/libapplayermodes.a operations/layer-modes-legacy/libapplayermodeslegacy.a gegl/libappgegl.a config/libappconfig.a ../libgimpconfig/.libs/libgimpconfig-2.0.so ../libgimpmath/.libs/libgimpmath-2.0.so ../libgimpthumb/.libs/libgimpthumb-2.0.so ../libgimpcolor/.libs/libgimpcolor-2.0.so ../libgimpmodule/.libs/libgimpmodule-2.0.so /var/tmp/portage/media-gfx/gimp-2.10.34-r2/work/gimp-2.10.34/libgimpconfig/.libs/libgimpconfig-2.0.so /var/tmp/portage/media-gfx/gimp-2.10.34-r2/work/gimp-2.10.34/libgimpcolor/.libs/libgimpcolor-2.0.so /var/tmp/portage/media-gfx/gimp-2.10.34-r2/work/gimp-2.10.34/libgimpmath/.libs/libgimpmath-2.0.so /var/tmp/portage/media-gfx/gimp-2.10.34-r2/work/gimp-2.10.34/libgimpbase/.libs/libgimpbase-2.0.so ../libgimpbase/.libs/libgimpbase-2.0.so -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype -lharfbuzz -lcairo -lgegl-0.4 -lgegl-npd-0.4 -lgmodule-2.0 -ljson-glib-1.0 -lbabl-0.1 -llcms2 -lgexiv2 -lgio-2.0 -lz -lmypaint -ljson-c -lgobject-2.0 -lglib-2.0 -lm -ldl -ljpeg -fopenmp -pthread ld.lld: error: undefined symbol: backtrace >>> referenced by gimpbacktrace-linux.c >>> gimpbacktrace-linux.o:(gimp_backtrace_signal_handler) in archive core/libappcore.a clang-15: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [Makefile:1048: gimp-2.10] Error 1
I create upstream issue https://gitlab.gnome.org/GNOME/gimp/-/issues/9452 maybe they could resolve it quicker. I will surprise if USE="unwind" will be workaround. But it strange that backstrace support isn't fully disabled with both `--without-libbacktrace` and `--without-libunwind` configuration options.
(In reply to Sergey Torokhov from comment #7) > I create upstream issue https://gitlab.gnome.org/GNOME/gimp/-/issues/9452 > maybe they could resolve it quicker. Thanks for taking it upstream! > I will surprise if USE="unwind" will be workaround. But it strange that > backstrace support isn't fully disabled with both `--without-libbacktrace` > and `--without-libunwind` configuration options. Can't try the possible workaround as this amd64/17.0/musl/clang (exp) system uses llvm-libunwind via clang-common and the gimp flag pulls in libunwind. ;)
We have to do it in the other file (sorry, I don't have it right now) where they define if backtrace is available. It's a header which defines a macro based on platform.
(In reply to Sam James from comment #9) > We have to do it in the other file (sorry, I don't have it right now) where > they define if backtrace is available. > > It's a header which defines a macro based on platform. Is it "app/core/gimpbacktrace-backend.h"? There is condition to #ifdef __gnu_linux__ to define GIMP_BACKTRACE_BACKEND_LINUX otherwise GIMP_BACKTRACE_BACKEND_NONE. Maybe if "#ifdef __gnu_linux__" will be extended with "&& __GLIBC__" it will solve the problem. I.e. "#if defined (__gnu_linux__) && defined (__GLIBC__)".
(In reply to Sergey Torokhov from comment #10) > (In reply to Sam James from comment #9) > > We have to do it in the other file (sorry, I don't have it right now) where > > they define if backtrace is available. > > > > It's a header which defines a macro based on platform. > > Is it "app/core/gimpbacktrace-backend.h"? There is condition to #ifdef > __gnu_linux__ to define GIMP_BACKTRACE_BACKEND_LINUX otherwise > GIMP_BACKTRACE_BACKEND_NONE. > > Maybe if "#ifdef __gnu_linux__" will be extended with "&& __GLIBC__" it will > solve the problem. I.e. "#if defined (__gnu_linux__) && defined (__GLIBC__)". Yes, that's it!
Created attachment 861864 [details] gimp-2.10.34-r2.ebuild I update ebuild with new sed-patch. Could you please check it?
(In reply to Sergey Torokhov from comment #12) > I update ebuild with new sed-patch. > Could you please check it? With the new ebuild gimp builds ok now. Thanks!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=112d496fe7ec2fb77132ec98cb4aca7e483767ba commit 112d496fe7ec2fb77132ec98cb4aca7e483767ba Author: Sergey Torokhov <torokhov-s-a@yandex.ru> AuthorDate: 2023-05-18 21:07:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-19 23:48:10 +0000 media-gfx/gimp: 2.10.34-r2 bump, fix 'execinfo.h' not found (musl) Closes: https://bugs.gentoo.org/900148 Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru> Signed-off-by: Sam James <sam@gentoo.org> ...mp-2.10_fix_musl_backtrace_backend_switch.patch | 15 ++ media-gfx/gimp/gimp-2.10.34-r2.ebuild | 213 +++++++++++++++++++++ 2 files changed, 228 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10e58b9d62f9b121e96ce9cf734148e09b75796e commit 10e58b9d62f9b121e96ce9cf734148e09b75796e Author: Sergey Torokhov <torokhov-s-a@yandex.ru> AuthorDate: 2023-05-18 21:21:15 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-05-20 06:57:10 +0000 media-gfx/gimp: (0/3) fix musl(+clang) build Bug: https://bugs.gentoo.org/900148 Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru> Closes: https://github.com/gentoo/gentoo/pull/30889 Signed-off-by: Sam James <sam@gentoo.org> media-gfx/gimp/gimp-2.99.14-r3.ebuild | 4 ++++ 1 file changed, 4 insertions(+)
The upsream issue ( https://gitlab.gnome.org/GNOME/gimp/-/issues/9452#note_2229346 ) info was updated and was closed with slightly differ patch ( https://gitlab.gnome.org/GNOME/gimp/-/commit/4b25148269090779f48d3131679227546394283e ) to "disable GimpBacktrace on Linux without execinfo.h".