Build fails with -Dlibunwind=false when libunwind is installed
Environment/Versions
- GIMP version number: 3.0.8
- Package: source
- Operating System: Gentoo Linux
- (if Linux) Display system: Wayland
Description of the bug
Build fails at the linking stage:
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: app/core/libappcore.a.p/gimpbacktrace-linux.c.o: in function `gimp_backtrace_get_address_info':
gimpbacktrace-linux.c:(.text+0xd19): undefined reference to `_ULx86_64_init_local'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: gimpbacktrace-linux.c:(.text+0xd61): undefined reference to `_ULx86_64_set_reg'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: gimpbacktrace-linux.c:(.text+0xd83): undefined reference to `_ULx86_64_get_proc_name'
collect2: error: ld returned 1 exit status
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- libunwind is installed
- meson setup with -Dlibunwind=false
- building with ninja fails
Expected result: build completes
Actual result: build fails
Additional information
I can fix for me with:
--- a/meson.build
+++ b/meson.build
@@ -725,7 +725,7 @@ libunwind = ( get_option('libunwind')
? dependency('libunwind', version: '>=1.1.0', required: false)
: no_dep
)
-have_unwind = libunwind.found() or cc.has_header('libunwind.h', required: false)
+have_unwind = libunwind.found()
conf.set('HAVE_LIBUNWIND', have_unwind ? 1 : false)
## Check for backtrace() API
But I guess that wouldn't be an acceptable patch. Personally I would always respect get_option('libunwind'), not have required: false as well as not look separately for 'libunwind.h'. But that goes for a lot more entries in meson.build too!