Package: mtr Version: 0.94-2 Severity: serious Tags: patch ftbfs Justification: fails to build from source (but built successfully in the past) User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu jammy ubuntu-patch X-Debbugs-Cc: sl...@ubuntu.com
Hi Robert, mtr fails to build from source, if compiled against glib2.0 >= v2.70, due to usage of deprecated GTimeVal in gtk+2.0 headers (that's a dependency of mtr). In Ubuntu, the attached patch was applied to achieve the following: * Fix FTBFS with glib >= 2.70 & deprecated definitions of GTimeVal in gtk+2.0 Thanks for considering the patch. Cheers, Lukas Build log: gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib/s390x-linux-gnu/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/s390x-linux-gnu -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/s390x-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o ui/mtr-gtk.o `test -f 'ui/gtk.c' || echo '../'`ui/gtk.c ../ui/curses.c: In function ‘mtr_curses_hosts’: ../ui/curses.c:435:17: error: format not a string literal and no format arguments [-Werror=format-security] 435 | printw(fmt_ipinfo(ctl, addr)); | ^~~~~~ ../ui/curses.c:488:21: error: format not a string literal and no format arguments [-Werror=format-security] 488 | printw(fmt_ipinfo(ctl, addrs)); | ^~~~~~ ../ui/curses.c: In function ‘mtr_curses_graph’: ../ui/curses.c:653:17: error: format not a string literal and no format arguments [-Werror=format-security] 653 | printw(fmt_ipinfo(ctl, addr)); | ^~~~~~ ../ui/curses.c: In function ‘mtr_curses_redraw’: ../ui/curses.c:703:5: error: format not a string literal and no format arguments [-Werror=format-security] 703 | mvprintw(1, maxx - 25, iso_time(&t)); | ^~~~~~~~ ../ui/curses.c:763:42: error: format not a string literal and no format arguments [-Werror=format-security] 763 | mvprintw(rowstat - 1, startstat, msg); | ^~~ gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/packet.o ../packet/packet.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/cmdparse.o ../packet/cmdparse.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/command.o ../packet/command.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/probe.o ../packet/probe.c In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:37, from /usr/include/gtk-2.0/gtk/gtkwidget.h:36, from /usr/include/gtk-2.0/gtk/gtkcontainer.h:35, from /usr/include/gtk-2.0/gtk/gtkbin.h:35, from /usr/include/gtk-2.0/gtk/gtkwindow.h:36, from /usr/include/gtk-2.0/gtk/gtkdialog.h:35, from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:33, from ../ui/gtk.c:31: /usr/include/gtk-2.0/gtk/gtktypeutils.h:236:1: warning: ‘GTypeDebugFlags’ is deprecated [-Wdeprecated-declarations] 236 | void gtk_type_init (GTypeDebugFlags debug_flags); | ^~~~ In file included from /usr/include/glib-2.0/gobject/gobject.h:24, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:22, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from ../ui/gtk.c:31: /usr/include/glib-2.0/gobject/gtype.h:698:1: note: declared here 698 | { | ^ In file included from /usr/include/string.h:519, from ../packet/probe.c:31: In function ‘strncat’, inlined from ‘respond_to_probe’ at ../packet/probe.c:296:9: /usr/include/s390x-linux-gnu/bits/string_fortified.h:135:10: warning: ‘__strncat_chk’ output may be truncated copying between 0 and 4095 bytes from a string of length 4095 [-Wstringop-truncation] 135 | return __builtin___strncat_chk (__dest, __src, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 136 | __glibc_objsize (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/gtk-2.0/gtk/gtktoolitem.h:31, from /usr/include/gtk-2.0/gtk/gtktoolbutton.h:30, from /usr/include/gtk-2.0/gtk/gtkmenutoolbutton.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:126, from ../ui/gtk.c:31: /usr/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations] 73 | GTimeVal last_popdown; | ^~~~~~~~ In file included from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:22, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from ../ui/gtk.c:31: /usr/include/glib-2.0/glib/gtypes.h:547:8: note: declared here 547 | struct _GTimeVal | ^~~~~~~~~ gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/timeval.o ../packet/timeval.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/sockaddr.o ../packet/sockaddr.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/construct_unix.o ../packet/construct_unix.c gcc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-pointer-sign -c -o packet/deconstruct_unix.o ../packet/deconstruct_unix.c cc1: some warnings being treated as errors make[2]: *** [Makefile:1159: ui/mtr-curses.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/<<PKGBUILDDIR>>/mtr' dh_auto_install: error: cd mtr && make -j4 install DESTDIR=/<<PKGBUILDDIR>>/debian/mtr AM_UPDATE_INFO_DIR=no returned exit code 2 make[1]: *** [debian/rules:39: override_dh_installdirs-arch] Error 25 make[1]: Leaving directory '/<<PKGBUILDDIR>>' make: *** [debian/rules:7: binary-arch] Error 2 dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit status 2 -- System Information: Debian Release: 11.0 APT prefers impish-updates APT policy: (500, 'impish-updates'), (500, 'impish-security'), (500, 'impish'), (100, 'impish-backports') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.13.0-20-generic (SMP w/4 CPU threads) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:en_GB:en Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru mtr-0.94/debian/rules mtr-0.94/debian/rules --- mtr-0.94/debian/rules 2021-08-23 20:17:06.000000000 +0200 +++ mtr-0.94/debian/rules 2021-11-15 16:58:04.000000000 +0100 @@ -2,6 +2,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +export DEB_CFLAGS_MAINT_APPEND = -Wno-error=deprecated-declarations -Wno-error=format-security %: dh $@