Package: botan1.10
Version: 1.10.5-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu trusty ubuntu-patch



In Ubuntu, the attached patch was applied to achieve the following:

  * ppc64el-support.patch: Add powerpc64le support to the upstream build
    system and update ppc64/altivec support for power7+ and power8 CPUs.
  * arm64-support.patch: Add arm64 support to the upstream build system.

These patches should be mostly self-explanatory.  The ppc64el one also
adds a bit more support for newer IBM CPUs for Altivec, perhaps not
meaningful for Debian, but should be submitted upstream all the same.

The only unfortunate thing here is that the Altivec code is very biased
to big-endian machines, so I've had to disable that for ppc64el for now.
I might find time to look into that later, though it's not a massive
priority.

... Adam

-- System Information:
Debian Release: jessie/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 'trusty')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.0-17-generic (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru botan1.10-1.10.5/debian/changelog botan1.10-1.10.5/debian/changelog
diff -Nru botan1.10-1.10.5/debian/patches/arm64-support.patch botan1.10-1.10.5/debian/patches/arm64-support.patch
--- botan1.10-1.10.5/debian/patches/arm64-support.patch	1969-12-31 17:00:00.000000000 -0700
+++ botan1.10-1.10.5/debian/patches/arm64-support.patch	2014-03-15 10:52:46.000000000 -0600
@@ -0,0 +1,38 @@
+Description: Add support for arm64.
+Author: Adam Conrad <[email protected]>
+
+Index: botan1.10-1.10.5/src/build-data/arch/aarch64.txt
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ botan1.10-1.10.5/src/build-data/arch/aarch64.txt	2014-03-15 10:52:05.448011048 -0600
+@@ -0,0 +1,6 @@
++endian little
++
++<aliases>
++arm64 # For Debian
++</aliases>
++
+Index: botan1.10-1.10.5/src/build-data/cc/gcc.txt
+===================================================================
+--- botan1.10-1.10.5.orig/src/build-data/cc/gcc.txt	2014-03-15 10:52:05.452011048 -0600
++++ botan1.10-1.10.5/src/build-data/cc/gcc.txt	2014-03-15 10:52:05.448011048 -0600
+@@ -74,6 +74,7 @@
+ 
+ alpha     -> "-mcpu=SUBMODEL" alpha-
+ arm       -> "-march=SUBMODEL"
++aarch64   -> "-mtune=generic"
+ superh    -> "-mSUBMODEL" sh
+ hppa      -> "-march=SUBMODEL" hppa
+ ia64      -> "-mtune=SUBMODEL"
+Index: botan1.10-1.10.5/src/math/mp/mp_asm64/info.txt
+===================================================================
+--- botan1.10-1.10.5.orig/src/math/mp/mp_asm64/info.txt	2014-03-15 10:52:05.452011048 -0600
++++ botan1.10-1.10.5/src/math/mp/mp_asm64/info.txt	2014-03-15 10:52:05.448011048 -0600
+@@ -8,6 +8,7 @@
+ </header:internal>
+ 
+ <arch>
++aarch64
+ alpha
+ ia64
+ mips64
diff -Nru botan1.10-1.10.5/debian/patches/ppc64el-support.patch botan1.10-1.10.5/debian/patches/ppc64el-support.patch
--- botan1.10-1.10.5/debian/patches/ppc64el-support.patch	1969-12-31 17:00:00.000000000 -0700
+++ botan1.10-1.10.5/debian/patches/ppc64el-support.patch	2014-03-15 11:16:47.000000000 -0600
@@ -0,0 +1,98 @@
+Description: Add support for ppc64el.
+Author: Adam Conrad <[email protected]>
+
+Index: botan1.10-1.10.5/src/build-data/arch/ppc64le.txt
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ botan1.10-1.10.5/src/build-data/arch/ppc64le.txt	2014-03-15 10:50:21.008012067 -0600
+@@ -0,0 +1,21 @@
++endian little
++
++family ppc
++
++<aliases>
++powerpc64le
++ppc64el
++</aliases>
++
++<submodels>
++power7
++power7p
++power8
++power8e
++</submodels>
++
++# This should be enabled for all targets, but the Altivec code currently
++# makes lots of endian assumptions that I don't have the time to fix up:
++#<isa_extn>
++#altivec:all
++#</isa_extn>
+Index: botan1.10-1.10.5/src/build-data/cc/gcc.txt
+===================================================================
+--- botan1.10-1.10.5.orig/src/build-data/cc/gcc.txt	2014-03-15 10:50:21.016012067 -0600
++++ botan1.10-1.10.5/src/build-data/cc/gcc.txt	2014-03-15 10:50:21.008012067 -0600
+@@ -82,6 +82,7 @@
+ mips64    -> "-mips3 -mcpu=SUBMODEL" mips64-
+ ppc32     -> "-mcpu=SUBMODEL" ppc
+ ppc64     -> "-mcpu=SUBMODEL" ppc
++ppc64le   -> "-mpcu=power7 -mtune=power8" ppc
+ sparc32   -> "-mcpu=SUBMODEL -Wa,-xarch=v8plus" sparc32-
+ sparc64   -> "-mcpu=v9 -mtune=SUBMODEL"
+ x86_32    -> "-march=SUBMODEL -momit-leaf-frame-pointer"
+Index: botan1.10-1.10.5/src/math/mp/mp_asm64/info.txt
+===================================================================
+--- botan1.10-1.10.5.orig/src/math/mp/mp_asm64/info.txt	2014-03-15 10:50:21.016012067 -0600
++++ botan1.10-1.10.5/src/math/mp/mp_asm64/info.txt	2014-03-15 10:50:21.008012067 -0600
+@@ -12,6 +12,7 @@
+ ia64
+ mips64
+ ppc64
++ppc64le
+ sparc64
+ </arch>
+ 
+Index: botan1.10-1.10.5/src/build-data/arch/ppc64.txt
+===================================================================
+--- botan1.10-1.10.5.orig/src/build-data/arch/ppc64.txt	2014-03-15 10:50:21.016012067 -0600
++++ botan1.10-1.10.5/src/build-data/arch/ppc64.txt	2014-03-15 10:50:21.008012067 -0600
+@@ -17,6 +17,9 @@
+ power5
+ power6
+ power7
++power7p
++power8
++power8e
+ cellppu
+ </submodels>
+ 
+@@ -25,5 +28,5 @@
+ </submodel_aliases>
+ 
+ <isa_extn>
+-altivec:cellppu,ppc970,power6,power7
++altivec:cellppu,ppc970,power6,power7,power7p,power8,power8e
+ </isa_extn>
+Index: botan1.10-1.10.5/src/utils/cpuid.cpp
+===================================================================
+--- botan1.10-1.10.5.orig/src/utils/cpuid.cpp	2014-03-15 10:50:21.016012067 -0600
++++ botan1.10-1.10.5/src/utils/cpuid.cpp	2014-03-15 10:50:21.012012067 -0600
+@@ -157,6 +157,9 @@
+    const u16bit PVR_G5_970GX = 0x0045;
+    const u16bit PVR_POWER6   = 0x003E;
+    const u16bit PVR_POWER7   = 0x003F;
++   const u16bit PVR_POWER7p  = 0x004A;
++   const u16bit PVR_POWER8   = 0x004D;
++   const u16bit PVR_POWER8E  = 0x004B;
+    const u16bit PVR_CELL_PPU = 0x0070;
+ 
+    // Motorola produced G4s with PVR 0x800[0123C] (at least)
+@@ -177,6 +180,9 @@
+    altivec_capable |= (pvr == PVR_G5_970GX);
+    altivec_capable |= (pvr == PVR_POWER6);
+    altivec_capable |= (pvr == PVR_POWER7);
++   altivec_capable |= (pvr == PVR_POWER7p);
++   altivec_capable |= (pvr == PVR_POWER8);
++   altivec_capable |= (pvr == PVR_POWER8E);
+    altivec_capable |= (pvr == PVR_CELL_PPU);
+ #endif
+ 
diff -Nru botan1.10-1.10.5/debian/patches/series botan1.10-1.10.5/debian/patches/series
--- botan1.10-1.10.5/debian/patches/series	2013-03-04 01:26:55.000000000 -0700
+++ botan1.10-1.10.5/debian/patches/series	2014-03-15 10:52:00.000000000 -0600
@@ -0,0 +1,2 @@
+ppc64el-support.patch
+arm64-support.patch

Reply via email to