Bug#777721: softhsm: FTBFS on arm64

2016-02-08 Thread Petter Reinholdtsen
This problem block mod-gnutls from building on arm64, and is one of the problems
blocking mod-gnutls from entering testing.  This is a problem for
freedombox-setup, which need mod-gnutls.

[Artur Rona]
> In Ubuntu, we've applied the attached patch to achieve the following:
> 
> - debian/patches/remove-64bit-check.diff:
>   + Remove the check for -m64, not needed for package builds.
> - debian/rules:
>   + Don't use unrecognized build flags on aarch64, resolving FTBFS

I suggest a different approach, where the macro is rewritten to first check if
the build is already 64bit, and if not, try with -m64 using this patch:

--- softhsm-1.3.7.orig/m4/acx_64bit.m4
+++ softhsm-1.3.7/m4/acx_64bit.m4
@@ -8,6 +8,10 @@ AC_DEFUN([ACX_64BIT],[
if test "x$enable_64bit" = "xyes"
then
AC_MSG_CHECKING(if we can compile in 64-bit mode)
+AC_RUN_IFELSE(
+[
+   AC_LANG_PROGRAM([],[return sizeof(void*) == 8 ? 
0 : 1;])
+], [], [
tmp_CFLAGS=$CFLAGS
CFLAGS="-m64"
AC_RUN_IFELSE(
@@ -24,6 +28,7 @@ AC_DEFUN([ACX_64BIT],[
CFLAGS=$tmp_CFLAGS
]
)
+])
fi
 
 ])

Note, the patch did not change the indentation of unrelated code.  This should
be done if the change is merged upstream, for consistent indentation.

I didn't change the indenation to make the patch easier to read.

-- 
Happy hacking
Petter Reinholdtsen



Bug#777721: softhsm: FTBFS on arm64

2015-02-11 Thread Artur Rona

Package: softhsm
Version: 1.3.7-2
Tags: patch
Usertags: origin-ubuntu ubuntu-patch vivid

#define PACKAGE_TARNAME softhsm
#define PACKAGE_VERSION 1.3.7
#define PACKAGE_STRING SoftHSM 1.3.7
#define PACKAGE_BUGREPORT 
#define PACKAGE_URL 
#define PACKAGE softhsm
#define VERSION 1.3.7

configure: exit 1
dh_auto_configure: ./configure --build=aarch64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libexecdir=${prefix}/lib/softhsm --disable-maintainer-mode 
--disable-dependency-tracking --sysconfdir=/etc/softhsm 
--localstatedir=/var/lib --with-botan=/usr --with-pic --enable-64bit 
LDFLAGS=-Wl,-z,defs -Wl,--as-needed returned exit code 1
make[1]: *** [override_dh_auto_configure] Error 25
debian/rules:22: recipe for target 'override_dh_auto_configure' failed
make[1]: Leaving directory '/«PKGBUILDDIR»'
make: *** [build-arch] Error 2
debian/rules:19: recipe for target 'build-arch' failed


In Ubuntu, we've applied the attached patch to achieve the following:

- debian/patches/remove-64bit-check.diff:
  + Remove the check for -m64, not needed for package builds.
- debian/rules:
  + Don't use unrecognized build flags on aarch64, resolving FTBFS

We thought you might be interested in doing the same.
diff -Nru softhsm-1.3.7/debian/patches/remove-64bit-check.diff 
softhsm-1.3.7/debian/patches/remove-64bit-check.diff
--- softhsm-1.3.7/debian/patches/remove-64bit-check.diff1970-01-01 
01:00:00.0 +0100
+++ softhsm-1.3.7/debian/patches/remove-64bit-check.diff2014-04-03 
13:59:17.0 +0200
@@ -0,0 +1,13 @@
+Index: b/configure.ac
+===
+--- a/configure.ac
 b/configure.ac
+@@ -63,8 +63,6 @@
+ [SOFTLOGLEVEL=3]
+ )
+ 
+-ACX_64BIT
+-
+ # Check for library include arguments
+ ACX_BOTAN
+ ACX_LIBSQLITE3
diff -Nru softhsm-1.3.7/debian/patches/series 
softhsm-1.3.7/debian/patches/series
--- softhsm-1.3.7/debian/patches/series 2014-12-01 17:52:26.0 +0100
+++ softhsm-1.3.7/debian/patches/series 2014-12-01 22:42:19.0 +0100
@@ -1,2 +1,3 @@
 SUPPORT-101.patch
 002_libtool_export_symbols_fix.patch
+remove-64bit-check.diff
diff -Nru softhsm-1.3.7/debian/rules softhsm-1.3.7/debian/rules
--- softhsm-1.3.7/debian/rules  2014-12-01 17:52:26.0 +0100
+++ softhsm-1.3.7/debian/rules  2015-02-11 00:52:59.0 +0100
@@ -6,7 +6,7 @@
 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
 
-SKIP_64BIT_ON_CPU=alpha ia64 mips64 mips64el
+SKIP_64BIT_ON_CPU=alpha ia64 mips64 mips64el aarch64
 
 ifeq ($(DEB_HOST_ARCH_BITS),64)
   # -m64 is not recognized on some architectures