Package: libreswan
Version: 3.19-1
Severity: important
Tags: sid + patch
Justification: FTBFS
User: debian-m...@lists.debian.org
Usertags: mips-patch


Package libreswan_3.19-1 FTBFS on mips and mipsel with following error:

> In file included from /usr/include/nspr/prtypes.h:26:0,
>                  from /usr/include/nspr/plarena.h:15,
>                  from /usr/include/nss/cert.h:13,
>                  from /«PKGBUILDDIR»/lib/libswan/nss_copies.c:6:
> /usr/include/nspr/prcpucfg.h:511:18: error: "_ABI64" is not defined 
> [-Werror=undef]
>  #if _MIPS_SIM == _ABI64
>                   ^~~~~~
> cc1: all warnings being treated as errors
> ../../../mk/depend.mk:28: recipe for target 'nss_copies.o' failed
> make[5]: *** [nss_copies.o] Error 1

Full build log:
https://buildd.debian.org/status/fetch.php?pkg=libreswan&arch=mips&ver=3.19-1&stamp=1485409760&raw=0

On 32-bit mips (ABIO32) _ABI64 is not defined so using -Wundef flag causes 
build failure.

I have created and attached a patch that exclude this flag for mips/mipsel.
With this patch package builds successfully on mips, mipsel and  mips64el.

Regards,
Radovan
--- libreswan-3.19_orig/debian/rules	2017-01-25 23:37:04.000000000 +0000
+++ libreswan-3.19/debian/rules	2017-02-02 20:01:47.654502204 +0000
@@ -1,5 +1,12 @@
 #!/usr/bin/make -f
 
+DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
+       ADDITIONAL_WARNING_CFLAGS = -Wall -Wextra -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wredundant-decls -Wnested-externs
+else
+       ADDITIONAL_WARNING_CFLAGS = -Wall -Wextra -Wformat -Wformat-nonliteral -Wundef -Wformat-security -Wmissing-declarations -Wredundant-decls -Wnested-externs
+endif
+
 %:
 	dh $@ --with systemd
 
@@ -17,7 +24,8 @@ override_dh_auto_build:
 		USE_LIBCAP_NG=true \
 		USE_LABELED_IPSEC=false \
 		USE_KLIPS=false \
-		USE_DNSSEC=true
+		USE_DNSSEC=true \
+		WARNING_CFLAGS="$(ADDITIONAL_WARNING_CFLAGS)"
 
 override_dh_auto_install-arch:
 	# Add here commands to install the package into debian/libreswan

Reply via email to