diff -Nru htslib-1.3/debian/changelog htslib-1.3/debian/changelog --- htslib-1.3/debian/changelog 2016-01-30 20:47:10.000000000 +0000 +++ htslib-1.3/debian/changelog 2016-02-06 03:20:57.000000000 +0000 @@ -1,3 +1,16 @@ +htslib (1.3-1+rpi1) stretch-staging; urgency=medium + + [changes brought forward from 1.2.1-1+rpi1 by Peter Michael Green at Tue, 29 Sep 2015 19:03:00 +0000] + * Fix bus errors in testsuite. + + [changes introduced in 1.2.1-2+rpi1 by Peter Michael Green] + * Cleanup duplicated patching with one version bad that made it impossible to unpack source package + manually. + * Remove single-debian-patch from debian/source/options, it was almost certainly responsible for + the above source package screwup. + + -- Raspbian forward porter Fri, 05 Feb 2016 09:03:06 +0000 + htslib (1.3-1) unstable; urgency=medium * Team upload diff -Nru htslib-1.3/debian/patches/alignment.patch htslib-1.3/debian/patches/alignment.patch --- htslib-1.3/debian/patches/alignment.patch 1970-01-01 00:00:00.000000000 +0000 +++ htslib-1.3/debian/patches/alignment.patch 2016-02-06 03:23:34.000000000 +0000 @@ -0,0 +1,119 @@ +Description: Fix alignment issues + Fix alignment issues identified through test failure with "BUS error" when + building on Debian armhf and raspbian. +Author: Peter Michael Green + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +Index: htslib-1.3/sam.c +=================================================================== +--- htslib-1.3.orig/sam.c ++++ htslib-1.3/sam.c +@@ -1056,6 +1056,12 @@ err_recover: + } + } + ++#define READUNALIGNED(ptr,type) ({ \ ++ type tmp;\ ++ memcpy(&tmp,ptr,sizeof(type));\ ++ tmp;\ ++}) ++ + int sam_format1(const bam_hdr_t *h, const bam1_t *b, kstring_t *str) + { + int i; +@@ -1119,36 +1125,36 @@ int sam_format1(const bam_hdr_t *h, cons + } else if (type == 'S') { + if (s+2 <= b->data + b->l_data) { + kputsn("i:", 2, str); +- kputw(*(uint16_t*)s, str); ++ kputw(READUNALIGNED(s,uint16_t), str); + s += 2; + } else return -1; + } else if (type == 's') { + if (s+2 <= b->data + b->l_data) { + kputsn("i:", 2, str); +- kputw(*(int16_t*)s, str); ++ kputw(READUNALIGNED(s,int16_t), str); + s += 2; + } else return -1; + } else if (type == 'I') { + if (s+4 <= b->data + b->l_data) { + kputsn("i:", 2, str); +- kputuw(*(uint32_t*)s, str); ++ kputuw(READUNALIGNED(s,uint32_t), str); + s += 4; + } else return -1; + } else if (type == 'i') { + if (s+4 <= b->data + b->l_data) { + kputsn("i:", 2, str); +- kputw(*(int32_t*)s, str); ++ kputw(READUNALIGNED(s,int32_t), str); + s += 4; + } else return -1; + } else if (type == 'f') { + if (s+4 <= b->data + b->l_data) { +- ksprintf(str, "f:%g", *(float*)s); ++ ksprintf(str, "f:%g", READUNALIGNED(s,float)); + s += 4; + } else return -1; + + } else if (type == 'd') { + if (s+8 <= b->data + b->l_data) { +- ksprintf(str, "d:%g", *(double*)s); ++ ksprintf(str, "d:%g", READUNALIGNED(s,double)); + s += 8; + } else return -1; + } else if (type == 'Z' || type == 'H') { +@@ -1172,11 +1178,11 @@ int sam_format1(const bam_hdr_t *h, cons + kputc(',', str); + if ('c' == sub_type) { kputw(*(int8_t*)s, str); ++s; } + else if ('C' == sub_type) { kputw(*(uint8_t*)s, str); ++s; } +- else if ('s' == sub_type) { kputw(*(int16_t*)s, str); s += 2; } +- else if ('S' == sub_type) { kputw(*(uint16_t*)s, str); s += 2; } +- else if ('i' == sub_type) { kputw(*(int32_t*)s, str); s += 4; } +- else if ('I' == sub_type) { kputuw(*(uint32_t*)s, str); s += 4; } +- else if ('f' == sub_type) { ksprintf(str, "%g", *(float*)s); s += 4; } ++ else if ('s' == sub_type) { kputw(READUNALIGNED(s,int16_t), str); s += 2; } ++ else if ('S' == sub_type) { kputw(READUNALIGNED(s,uint16_t), str); s += 2; } ++ else if ('i' == sub_type) { kputw(READUNALIGNED(s,int32_t), str); s += 4; } ++ else if ('I' == sub_type) { kputuw(READUNALIGNED(s,uint32_t), str); s += 4; } ++ else if ('f' == sub_type) { ksprintf(str, "%g", READUNALIGNED(s,float)); s += 4; } + else return -1; + } + } +@@ -1283,9 +1289,9 @@ int32_t bam_aux2i(const uint8_t *s) + type = *s++; + if (type == 'c') return (int32_t)*(int8_t*)s; + else if (type == 'C') return (int32_t)*(uint8_t*)s; +- else if (type == 's') return (int32_t)*(int16_t*)s; +- else if (type == 'S') return (int32_t)*(uint16_t*)s; +- else if (type == 'i' || type == 'I') return *(int32_t*)s; ++ else if (type == 's') return (int32_t)READUNALIGNED(s,int16_t); ++ else if (type == 'S') return (int32_t)READUNALIGNED(s,uint16_t); ++ else if (type == 'i' || type == 'I') return READUNALIGNED(s,int32_t); + else return 0; + } + +@@ -1293,8 +1299,8 @@ double bam_aux2f(const uint8_t *s) + { + int type; + type = *s++; +- if (type == 'd') return *(double*)s; +- else if (type == 'f') return *(float*)s; ++ if (type == 'd') return READUNALIGNED(s,double); ++ else if (type == 'f') return READUNALIGNED(s,float); + else return 0.0; + } + diff -Nru htslib-1.3/debian/patches/series htslib-1.3/debian/patches/series --- htslib-1.3/debian/patches/series 2016-01-30 20:47:10.000000000 +0000 +++ htslib-1.3/debian/patches/series 2016-02-06 03:20:57.000000000 +0000 @@ -1 +1,2 @@ define_PATH_MAX.patch +alignment.patch diff -Nru htslib-1.3/debian/source/options htslib-1.3/debian/source/options --- htslib-1.3/debian/source/options 2016-01-30 20:47:10.000000000 +0000 +++ htslib-1.3/debian/source/options 2016-02-06 03:20:57.000000000 +0000 @@ -1,2 +1 @@ -single-debian-patch extend-diff-ignore = "^(\.travis\.yml|README.md)$"