diff -Nru mtd-utils-2.1.6/debian/changelog mtd-utils-2.1.6/debian/changelog --- mtd-utils-2.1.6/debian/changelog 2024-03-04 20:02:29.000000000 +0000 +++ mtd-utils-2.1.6/debian/changelog 2024-04-05 10:11:30.000000000 +0100 @@ -1,3 +1,9 @@ +mtd-utils (1:2.1.6-1ubuntu1) noble; urgency=medium + + * d/p/fix-ftbfs.patch: Disable LTO in unittests. (LP: #2060214) + + -- Sudip Mukherjee Fri, 05 Apr 2024 10:11:30 +0100 + mtd-utils (1:2.1.6-1build1) noble; urgency=medium * No-change rebuild against libssl3t64 diff -Nru mtd-utils-2.1.6/debian/patches/fix-ftbfs.patch mtd-utils-2.1.6/debian/patches/fix-ftbfs.patch --- mtd-utils-2.1.6/debian/patches/fix-ftbfs.patch 1970-01-01 01:00:00.000000000 +0100 +++ mtd-utils-2.1.6/debian/patches/fix-ftbfs.patch 2024-04-05 10:11:18.000000000 +0100 @@ -0,0 +1,23 @@ +Description: Disable LTO for tests + The tests are using fakeread using --wrap=read, but if LTO is enabled + then its not linking with the wrapped read but instead trying to use + the real read(). +Author: Sudip Mukherjee +Bug-Ubuntu: https://launchpad.net/bugs/2060214 +Forwarded: no +Last-Update: 2024-04-05 +--- + +diff --git a/tests/unittests/Makemodule.am b/tests/unittests/Makemodule.am +index 277cac2..df249e3 100644 +--- a/tests/unittests/Makemodule.am ++++ b/tests/unittests/Makemodule.am +@@ -7,7 +7,7 @@ ubilib_test_CPPFLAGS = -O0 --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/include + mtdlib_test_SOURCES = tests/unittests/libmtd_test.c lib/libmtd.c lib/libmtd_legacy.c + mtdlib_test_SOURCES += tests/unittests/test_lib.h + mtdlib_test_LDADD = $(CMOCKA_LIBS) +-mtdlib_test_LDFLAGS = -Wl,--wrap=open -Wl,--wrap=close -Wl,--wrap=ioctl -Wl,--wrap=read -Wl,--wrap=lseek -Wl,--wrap=write ++mtdlib_test_LDFLAGS = -Wl,--wrap=open -Wl,--wrap=close -Wl,--wrap=ioctl -Wl,--wrap=read -Wl,--wrap=lseek -Wl,--wrap=write -fno-lto + mtdlib_test_CPPFLAGS = -O0 -D_GNU_SOURCE --std=gnu99 $(CMOCKA_CFLAGS) -I$(top_srcdir)/lib/ -I$(top_srcdir)/include -DSYSFS_ROOT='"$(top_srcdir)/tests/unittests/sysfs_mock"' + + TEST_BINS = \ diff -Nru mtd-utils-2.1.6/debian/patches/series mtd-utils-2.1.6/debian/patches/series --- mtd-utils-2.1.6/debian/patches/series 2023-09-04 16:20:02.000000000 +0100 +++ mtd-utils-2.1.6/debian/patches/series 2024-04-05 10:06:40.000000000 +0100 @@ -1 +1,2 @@ link-with-system-iniparser.diff +fix-ftbfs.patch