Source: bowtie
Version: 1.1.2-5
Severity: wishlist
Tags: patch


I've attached a patch adding support for all the other 64-bit arches
which have Debian ports.

Instead of listing them all in the Makefile, I invoked gcc to ask if it
was using 64-bit pointers (using __LP64__). This is important on some
arches (like mips) since the 32-bit mips buildds run 64-bit kernels and
running "uname -m" gives "mips64".

Tested on mips64el.

diff -Nru bowtie-1.1.2/debian/control bowtie-1.1.2/debian/control
--- bowtie-1.1.2/debian/control	2016-05-25 23:44:22.000000000 +0100
+++ bowtie-1.1.2/debian/control	2016-10-14 14:47:00.000000000 +0100
@@ -15,7 +15,7 @@
 Package: bowtie
-Architecture: amd64 kfreebsd-amd64 arm64 ppc64el
+Architecture: alpha any-amd64 arm64 mips64el ppc64 ppc64el s390x sparc64
 Depends: ${shlibs:Depends},
diff -Nru bowtie-1.1.2/debian/patches/gcc-64bit.patch bowtie-1.1.2/debian/patches/gcc-64bit.patch
--- bowtie-1.1.2/debian/patches/gcc-64bit.patch	1970-01-01 01:00:00.000000000 +0100
+++ bowtie-1.1.2/debian/patches/gcc-64bit.patch	2016-10-14 14:47:00.000000000 +0100
@@ -0,0 +1,23 @@
+Description: Use gcc to determine if an arch is 64-bit
+ uname -m is misleading when determining if an arch is 64-bit or not
+ - It indicates the _build_ machine's processor which may not be the same as the
+   processor the code is being built for (cross compiling).
+ - It fails if a 32-bit compiler is used on a 64-bit cpu (eg build i386 packages
+   on x86_64). This is common on the mips buildds.
+ Therefore ask GCC if this architecture is 64-bit. Using __LP64__ is the easiest
+ method, but is not portable and probably only works with GCC and Clang
+ unfortunatly.
+Author: James Cowgill <>
+This patch header follows DEP-3:
+--- a/Makefile
++++ b/Makefile
+@@ -125,7 +125,7 @@ SEARCH_FRAGMENTS = $(wildcard search_*_p
+ VERSION = $(shell cat VERSION)
+ BITS=32
+-ifneq (,$(filter $(shell uname -m), aarch64 ppc64le x86_64))
++ifeq (1,$(shell echo __LP64__ | $(CC) -P -E -))
+ 	BITS=64
+ endif
+ # msys will always be 32 bit so look at the cpu arch instead.
diff -Nru bowtie-1.1.2/debian/patches/series bowtie-1.1.2/debian/patches/series
--- bowtie-1.1.2/debian/patches/series	2016-05-25 23:03:35.000000000 +0100
+++ bowtie-1.1.2/debian/patches/series	2016-10-14 14:47:00.000000000 +0100
@@ -12,3 +12,4 @@

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to