Source: libpff
Version: 20180714-2
Severity: normal
Tags: ftbfs patch upstream
User: debian-ri...@lists.debian.org
Usertags: riscv64

Hi,

libpff fails to build on riscv64:
https://buildd.debian.org/status/fetch.php?pkg=libpff&arch=riscv64&ver=20180714-2&stamp=1580068149&raw=0

This is due to fundamentally broken tests assuming that memcpy and
memset can fail returning NULL, and interposing these libc functions in
the tests with functions that sometimes return NULL. This tests should
be simply removed as they do not make sense. See bug #978433 for more
details as the same code is basically replicated in dozen of packages.

A simpler way to fix the issue for riscv64 is to disable all memory
tests on this architecture, as it is already done for a long list of
cases. This is what the patch below does:

--- libpff-20180714/debian/patches/04-disable-memory-tests-on-riscv64.patch     
1970-01-01 01:00:00.000000000 +0100
+++ libpff-20180714/debian/patches/04-disable-memory-tests-on-riscv64.patch     
2020-12-27 15:08:04.000000000 +0100
@@ -0,0 +1,11 @@
+--- libpff-20180714.orig/tests/pff_test_memory.h
++++ libpff-20180714/tests/pff_test_memory.h
+@@ -28,7 +28,7 @@
+ extern "C" {
+ #endif
+ 
+-#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( 
LIBPFF_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && 
!defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && 
!defined( __sparc__ ) && !defined( HAVE_ASAN )
++#if defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( 
LIBPFF_DLL_IMPORT ) && !defined( __arm__ ) && !defined( __clang__ ) && 
!defined( __CYGWIN__ ) && !defined( __hppa__ ) && !defined( __mips__ ) && 
!defined( __sparc__ ) && !defined( __riscv ) && !defined( HAVE_ASAN )
+ #define HAVE_PFF_TEST_MEMORY          1
+ #endif
+ 
--- libpff-20180714/debian/patches/series       2020-01-19 22:36:49.000000000 
+0100
+++ libpff-20180714/debian/patches/series       2020-12-27 15:08:04.000000000 
+0100
@@ -1,3 +1,4 @@
 01-fix-spelling-binary.patch
 02-fix-man-pages-pffexport-and-pffinfo.patch
 03-fixes-for-libpff-manpage.patch
+04-disable-memory-tests-on-riscv64.patch

Regards,
Aurelien

Reply via email to