code:
This patch fixes an issues where temporary files were created in an insecure
way.

It was first intruduced in version 3.8.3-7 and fixes
http://bugs.debian.org/438540
--- a/src/tag_file.cpp
+++ b/src/tag_file.cpp
@@ -242,8 +242,8 @@
     strcpy(sTempFile, filename.c_str());
     strcat(sTempFile, sTmpSuffix.c_str());

-#if ((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
-    // This section is for Windows folk && gcc 3.x folk
+#if !defined(HAVE_MKSTEMP)
+    // This section is for Windows folk
     fstream tmpOut;
     createFile(sTempFile, tmpOut);

@@ -257,7 +257,7 @@
       tmpOut.write((char *)tmpBuffer, nBytes);
     }

-#else //((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#else //!defined(HAVE_MKSTEMP)

     // else we gotta make a temp file, copy the tag into it, copy the
     // rest of the old file after the tag, delete the old file, rename
@@ -270,7 +270,7 @@
       //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
     }

-    ofstream tmpOut(fd);
+    ofstream tmpOut(sTempFile);
     if (!tmpOut)
     {
       tmpOut.close();
@@ -285,14 +285,14 @@
     uchar tmpBuffer[BUFSIZ];
     while (file)
     {
-      file.read(tmpBuffer, BUFSIZ);
+      file.read((char *)tmpBuffer, BUFSIZ);
       size_t nBytes = file.gcount();
-      tmpOut.write(tmpBuffer, nBytes);
+      tmpOut.write((char *)tmpBuffer, nBytes);
     }

     close(fd); //closes the file

-#endif ////((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#endif ////!defined(HAVE_MKSTEMP)

     tmpOut.close();
     file.close();


code:
diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
--- id3lib-3.8.3.orig/ChangeLog	2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/ChangeLog	2006-02-22 00:33:59.946214472 +0100
@@ -1,3 +1,8 @@
+2006-02-17  Jerome Couderc
+
+    * Patch from Spoon to fix UTF-16 writing bug
+      http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+
 2003-03-02 Sunday 17:38   Thijmen Klok <thijmen@id3lib.org>

 	* THANKS (1.20): added more people
diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
--- id3lib-3.8.3.orig/src/io_helpers.cpp	2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/src/io_helpers.cpp	2006-02-22 00:35:02.926639992 +0100
@@ -363,11 +363,22 @@
     // Write the BOM: 0xFEFF
     unicode_t BOM = 0xFEFF;
     writer.writeChars((const unsigned char*) &BOM, 2);
+    // Patch from Spoon : 2004-08-25 14:17
+    //   http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+    // Wrong code
+    //for (size_t i = 0; i < size; i += 2)
+    //{
+    //  unicode_t ch = (data[i] << 8) | data[i+1];
+    //  writer.writeChars((const unsigned char*) &ch, 2);
+    //}
+    // Right code
+    unsigned char *pdata = (unsigned char *) data.c_str();
     for (size_t i = 0; i < size; i += 2)
     {
-      unicode_t ch = (data[i] << 8) | data[i+1];
+      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
       writer.writeChars((const unsigned char*) &ch, 2);
     }
+    // End patch
   }
   return writer.getCur() - beg;
 }

license: mit


code:
Fix FTBFS on i686-linux due to rounding issue (see references).

Fixes Guix bug #22049 (see below).

Copied from Debian.

Source:
https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBoxAlgo.patch/
https://sources.debian.net/src/ilmbase/2.2.0-11/debian/patches/testBox.patch/

References:
https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22049
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815712
https://anonscm.debian.org/cgit/pkg-phototools/ilmbase.git/commit/?id=ab28bb45cdad8adc32e345b777ab8e692b1d9a9c

---

Subject: testBoxAlgo: allow fuzzy match of b12 == b2
From: Steven Chamberlain <steven@pyro.eu.org>
Date: Wed, 24 Feb 2016 01:04:11 +0000

Also fix a pre-existing typo.

--- a/IlmBase/ImathTest/testBoxAlgo.cpp
+++ b/IlmBase/ImathTest/testBoxAlgo.cpp
@@ -886,10 +886,11 @@ boxMatrixTransform ()

     assert (approximatelyEqual (b2.min, b4.min, e));
     assert (approximatelyEqual (b2.max, b4.max, e));
-    assert (approximatelyEqual (b3.max, b4.max, e));
+    assert (approximatelyEqual (b3.min, b4.min, e));
     assert (approximatelyEqual (b3.max, b4.max, e));

-    assert (b21 == b2);
+    assert (approximatelyEqual (b2.min, b21.min, e));
+    assert (approximatelyEqual (b2.max, b21.max, e));
     assert (b31 == b3);

     M[0][3] = 1;

---

Subject: testBox: allow fuzzy comparison of floats, doubles
From: Steven Chamberlain <steven@pyro.eu.org>
Date: Wed, 24 Feb 2016 01:10:11 +0000

Allow for inexact values, as long as the error is smaller than the
epsilon of the data type.

On 32-bit x86, allow even greater discrepency at double
precision, due to possible double-rounding.  See
https://lists.nongnu.org/archive/html/openexr-devel/2015-12/msg00001.html

--- a/IlmBase/ImathTest/testBox.cpp
+++ b/IlmBase/ImathTest/testBox.cpp
@@ -47,6 +47,58 @@ using namespace IMATH_INTERNAL_NAMESPACE

 namespace {

+template <class T>
+bool
+approximatelyEqual (const T &p1, const T &p2)
+{
+	/* int and short should be exact */
+	return (p1 == p2);
+}
+
+bool
+approximatelyEqual (const Vec2<float> &p1, const Vec2<float> &p2)
+{
+    float e = limits<float>::epsilon();
+    float m = 0;
+
+    for (int i = 0; i < 2; ++i)
+    {
+	m = max (m, abs (p1[i]));
+	m = max (m, abs (p2[i]));
+    }
+
+    for (int i = 0; i < 2; ++i)
+	if (!equalWithAbsError (p1[i], p2[i], m * e))
+	    return false;
+
+    return true;
+}
+
+bool
+approximatelyEqual (const Vec2<double> &p1, const Vec2<double> &p2)
+{
+#if defined(__i386__) || defined(_M_IX86)
+    /* double-rounding on 32-bit x86 may cause larger error:
+       use epsilon of float rather than double */
+    double e = limits<float>::epsilon();
+#else
+    double e = limits<double>::epsilon();
+#endif
+    double m = 0;
+
+    for (int i = 0; i < 2; ++i)
+    {
+	m = max (m, abs (p1[i]));
+	m = max (m, abs (p2[i]));
+    }
+
+    for (int i = 0; i < 2; ++i)
+	if (!equalWithAbsError (p1[i], p2[i], m * e))
+	    return false;
+
+    return true;
+}
+
 //
 // Test case generation utility - create a vector of IMATH_INTERNAL_NAMESPACE::Vec{2,3,4}
 // with all permutations of integers 1..T::dimensions().
@@ -250,7 +302,8 @@ testExtendByPoint(const char *type)

         IMATH_INTERNAL_NAMESPACE::Box<T> b;
         b.extendBy(p);
-        assert(b.min == p && b.max == p);
+        assert (approximatelyEqual (b.min, p));
+        assert (approximatelyEqual (b.max, p));
     }

     //
@@ -283,7 +336,8 @@ testExtendByPoint(const char *type)

             b.extendBy(p);

-            assert(b.min == min && b.max == max);
+            assert (approximatelyEqual (b.min, min));
+            assert (approximatelyEqual (b.max, max));
         }
     }
 }
@@ -358,7 +412,8 @@ testExtendByBox(const char *type)
             }
             b.extendBy(IMATH_INTERNAL_NAMESPACE::Box<T>(p0, p1));

-            assert(b.min == min && b.max == max);
+            assert (approximatelyEqual (b.min, min));
+            assert (approximatelyEqual (b.max, max));
         }
     }
 }


code:
Support compiling on the Hurd.

Taken from https://git.hadrons.org/cgit/debian/pkgs/inetutils.git/tree/debian/patches/0002-ifconfig-Improve-the-support-for-GNU-Hurd.patch

From 9a90d9b9119906df23cb2db1503cb0f099942dd9 Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <gnu@gisladisker.se>
Date: Sat, 18 Jul 2015 01:12:41 +0200
Subject: [PATCH 02/35] ifconfig: Improve the support for GNU/Hurd.

Use system specific code instead of generic code.
This provides abilities similar to other systems.
---
 ChangeLog                   |  17 +++
 ifconfig/system.c           |  10 +-
 ifconfig/system.h           |   2 +
 ifconfig/system/Makefile.am |   4 +-
 ifconfig/system/generic.c   |  14 +-
 ifconfig/system/hurd.c      | 292 ++++++++++++++++++++++++++++++++++++
 ifconfig/system/hurd.h      |  50 ++++++
 7 files changed, 381 insertions(+), 8 deletions(-)
 create mode 100644 ifconfig/system/hurd.c
 create mode 100644 ifconfig/system/hurd.h

diff --git a/ifconfig/system.c b/ifconfig/system.c
index 30677e41..e108dc2e 100644
--- a/ifconfig/system.c
+++ b/ifconfig/system.c
@@ -25,10 +25,12 @@
 # include "system/solaris.c"
 #elif defined __QNX__
 # include "system/qnx.c"
-# elif defined __DragonFly__ || defined __FreeBSD__ || \
-       defined __FreeBSD_kernel__ || \
-       defined __NetBSD__ || defined __OpenBSD__
-#  include "system/bsd.c"
+#elif defined __DragonFly__ || defined __FreeBSD__ || \
+      defined __FreeBSD_kernel__ || \
+      defined __NetBSD__ || defined __OpenBSD__
+# include "system/bsd.c"
+#elif defined __GNU__
+# include "system/hurd.c"
 #else
 # include "system/generic.c"
 #endif
diff --git a/ifconfig/system.h b/ifconfig/system.h
index 8521ad95..66878d3a 100644
--- a/ifconfig/system.h
+++ b/ifconfig/system.h
@@ -97,6 +97,8 @@ extern struct if_nameindex* (*system_if_nameindex) (void);
        defined __FreeBSD_kernel__ || \
        defined __NetBSD__ || defined __OpenBSD__
 #  include "system/bsd.h"
+# elif defined __GNU__
+#  include "system/hurd.h"
 # else
 #  include "system/generic.h"
 # endif
diff --git a/ifconfig/system/Makefile.am b/ifconfig/system/Makefile.am
index 954c6774..62a9f1c4 100644
--- a/ifconfig/system/Makefile.am
+++ b/ifconfig/system/Makefile.am
@@ -26,8 +26,10 @@ noinst_HEADERS = \
 	linux.h \
 	solaris.h \
 	qnx.h \
+	hurd.h \
 	bsd.c \
 	generic.c \
 	linux.c \
 	solaris.c \
-	qnx.c
+	qnx.c \
+	hurd.c
diff --git a/ifconfig/system/generic.c b/ifconfig/system/generic.c
index 9a2bda55..20a78bde 100644
--- a/ifconfig/system/generic.c
+++ b/ifconfig/system/generic.c
@@ -22,6 +22,8 @@
 #include <config.h>

 #include "../ifconfig.h"
+
+#include <unused-parameter.h>

 /* Output format stuff.  */
@@ -36,19 +38,25 @@ const char *system_help;
 struct argp_child system_argp_child;

 int
-system_parse_opt (struct ifconfig **ifp, char option, char *optarg)
+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
+		  char option _GL_UNUSED_PARAMETER,
+		  char *optarg _GL_UNUSED_PARAMETER)
 {
   return 0;
 }

 int
-system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
+system_parse_opt_rest (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
+		       int argc _GL_UNUSED_PARAMETER,
+		       char *argv[] _GL_UNUSED_PARAMETER)
 {
   return 0;
 }

 int
-system_configure (int sfd, struct ifreq *ifr, struct system_ifconfig *ifs)
+system_configure (int sfd _GL_UNUSED_PARAMETER,
+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
 {
   return 0;
 }
diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
new file mode 100644
index 00000000..3bd19775
--- /dev/null
+++ b/ifconfig/system/hurd.c
@@ -0,0 +1,292 @@
+/* hurd.c -- Code for ifconfig specific to GNU/Hurd.
+  Copyright (C) 2015 Free Software Foundation, Inc.
+
+  This file is part of GNU Inetutils.
+
+  GNU Inetutils is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or (at
+  your option) any later version.
+
+  GNU Inetutils is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
+
+/* Mostly written by Marcus Brinkmann.
+   Adaptions to GNU/Hurd by Mats Erik Andersson.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <net/if_arp.h>
+#include "../ifconfig.h"
+
+#include <unused-parameter.h>
+
+
+/* Output format stuff.  */
+
+const char *system_default_format = "gnu";
+
+
+/* Argument parsing stuff.  */
+
+const char *system_help = "NAME [ADDR]\
+ [broadcast BRDADDR] [netmask MASK]\
+ [mtu N] [up|down] [FLAGS]";
+
+struct argp_child system_argp_child;
+
+int
+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
+		  char option _GL_UNUSED_PARAMETER,
+		  char *optarg _GL_UNUSED_PARAMETER)
+{
+  return 0;
+}
+
+int
+system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
+{
+  int i = 0, mask, rev;
+  enum {
+    EXPECT_NOTHING,
+    EXPECT_AF,
+    EXPECT_BROADCAST,
+    EXPECT_NETMASK,
+    EXPECT_METRIC,
+    EXPECT_MTU
+  } expect = EXPECT_AF;
+
+  *ifp = parse_opt_new_ifs (argv[0]);
+
+  while (++i < argc)
+    {
+      switch (expect)
+	{
+	case EXPECT_BROADCAST:
+	  parse_opt_set_brdaddr (*ifp, argv[i]);
+	  break;
+
+	case EXPECT_NETMASK:
+	  parse_opt_set_netmask (*ifp, argv[i]);
+	  break;
+
+	case EXPECT_MTU:
+	  parse_opt_set_mtu (*ifp, argv[i]);
+	  break;
+
+	/* XXX: 2015-07-18, GNU/Hurd does not yet support
+		ioctl(SIOCSIFMETRIC), but we let the code
+		handle this standard ability anyway!
+	 */
+	case EXPECT_METRIC:
+	  parse_opt_set_metric (*ifp, argv[i]);
+	  break;
+
+	case EXPECT_AF:
+	  expect = EXPECT_NOTHING;
+	  if (!strcmp (argv[i], "inet"))
+	    continue;
+	  else if (!strcmp (argv[i], "inet6"))
+	    {
+	      error (0, 0, "%s is not a supported address family", argv[i]);
+	      return 0;
+	    }
+	  break;
+
+	case EXPECT_NOTHING:
+	  break;
+	}
+
+      if (expect != EXPECT_NOTHING)
+	expect = EXPECT_NOTHING;
+      else if (!strcmp (argv[i], "broadcast"))
+	expect = EXPECT_BROADCAST;
+      else if (!strcmp (argv[i], "netmask"))
+	expect = EXPECT_NETMASK;
+      else if (!strcmp (argv[i], "metric"))
+	expect = EXPECT_METRIC;
+      else if (!strcmp (argv[i], "mtu"))
+	expect = EXPECT_MTU;
+      else if (!strcmp (argv[i], "up"))
+	parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
+      else if (!strcmp (argv[i], "down"))
+	parse_opt_set_flag (*ifp, IFF_UP, 1);
+      else if (((mask = if_nameztoflag (argv[i], &rev))
+		& ~IU_IFF_CANTCHANGE) != 0)
+	parse_opt_set_flag (*ifp, mask, rev);
+      else
+	{
+	  if (!((*ifp)->valid & IF_VALID_ADDR))
+	    parse_opt_set_address (*ifp, argv[i]);
+	  else if (!((*ifp)->valid & IF_VALID_DSTADDR))
+	    parse_opt_set_dstaddr (*ifp, argv[i]);
+	}
+    }
+
+  switch (expect)
+    {
+    case EXPECT_BROADCAST:
+      error (0, 0, "option `broadcast' requires an argument");
+      break;
+
+    case EXPECT_NETMASK:
+      error (0, 0, "option `netmask' requires an argument");
+      break;
+
+    case EXPECT_METRIC:
+      error (0, 0, "option `metric' requires an argument");
+      break;
+
+    case EXPECT_MTU:
+      error (0, 0, "option `mtu' requires an argument");
+      break;
+
+    case EXPECT_AF:
+    case EXPECT_NOTHING:
+      return 1;
+    }
+
+  return 0;
+}
+
+int
+system_configure (int sfd _GL_UNUSED_PARAMETER,
+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
+{
+  return 0;
+}
+
+struct if_nameindex* (*system_if_nameindex) (void) = if_nameindex;
+
+static void
+print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
+		    unsigned char *data)
+{
+  *column += printf ("%02X:%02X:%02X:%02X:%02X:%02X",
+		     data[0], data[1], data[2], data[3], data[4], data[5]);
+  had_output = 1;
+}
+
+struct arphrd_symbol
+{
+  const char *name;
+  const char *title;
+  int value;
+  void (*print_hwaddr) (format_data_t form, unsigned char *data);
+} arphrd_symbols[] =
+  {
+#ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
+    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
+#endif
+#ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
+#endif
+    /* XXX: The image debian-hurd-20150424 returns the value 4
+	    instead of expected ARPHRD_LOOPBACK.  This has been
+	    discussed in the list debian-hurd, where I was asked
+	    to resist the temptation of a work around!
+     */
+    { NULL, NULL, 0, NULL}
+  };
+
+struct arphrd_symbol *
+arphrd_findvalue (int value)
+{
+  struct arphrd_symbol *arp = arphrd_symbols;
+  while (arp->name != NULL)
+    {
+      if (arp->value == value)
+	break;
+      arp++;
+    }
+  if (arp->name)
+    return arp;
+  else
+    return NULL;
+}
+
+void
+system_fh_hwaddr_query (format_data_t form, int argc, char *argv[])
+{
+#ifdef SIOCGIFHWADDR
+  struct arphrd_symbol *arp;
+
+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
+    select_arg (form, argc, argv, 1);
+
+  arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
+  select_arg (form, argc, argv, (arp && arp->print_hwaddr) ? 0 : 1);
+#else
+  select_arg (form, argc, argv, 1);
+#endif
+}
+
+void
+system_fh_hwaddr (format_data_t form, int argc _GL_UNUSED_PARAMETER,
+		  char *argv[] _GL_UNUSED_PARAMETER)
+{
+#ifdef SIOCGIFHWADDR
+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
+    error (EXIT_FAILURE, errno,
+	   "SIOCGIFHWADDR failed for interface `%s'",
+	   form->ifr->ifr_name);
+  else
+    {
+      struct arphrd_symbol *arp;
+
+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
+      if (arp && arp->print_hwaddr)
+	arp->print_hwaddr (form,
+			   (unsigned char *) form->ifr->ifr_hwaddr.sa_data);
+      else
+	put_string (form, "(hwaddr unknown)");
+    }
+#else
+  *column += printf ("(not available)");
+  had_output = 1;
+#endif
+}
+
+void
+system_fh_hwtype_query (format_data_t form, int argc, char *argv[])
+{
+#ifdef SIOCGIFHWADDR
+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) >= 0)
+    select_arg (form, argc, argv, 0);
+  else
+#endif
+    select_arg (form, argc, argv, 1);
+}
+
+void
+system_fh_hwtype (format_data_t form, int argc _GL_UNUSED_PARAMETER,
+		  char *argv[] _GL_UNUSED_PARAMETER)
+{
+#ifdef SIOCGIFHWADDR
+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
+    error (EXIT_FAILURE, errno,
+	   "SIOCGIFHWADDR failed for interface `%s'",
+	   form->ifr->ifr_name);
+  else
+    {
+      struct arphrd_symbol *arp;
+
+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
+      if (arp)
+	put_string (form, arp->title);
+      else
+	put_string (form, "(hwtype unknown)");
+    }
+#else
+  *column += printf ("(not available)");
+  had_output = 1;
+#endif
+}
diff --git a/ifconfig/system/hurd.h b/ifconfig/system/hurd.h
new file mode 100644
index 00000000..bab14565
--- /dev/null
+++ b/ifconfig/system/hurd.h
@@ -0,0 +1,50 @@
+/*
+  Copyright (C) 2015 Free Software Foundation, Inc.
+
+  This file is part of GNU Inetutils.
+
+  GNU Inetutils is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or (at
+  your option) any later version.
+
+  GNU Inetutils is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
+
+/* Written by Mats Erik Andersson.  */
+
+#ifndef IFCONFIG_SYSTEM_HURD_H
+# define IFCONFIG_SYSTEM_HURD_H
+
+# include "../printif.h"
+# include "../options.h"
+
+
+/* Option support.  */
+
+struct system_ifconfig
+{
+  int valid;
+};
+
+
+/* Output format support.  */
+
+# define SYSTEM_FORMAT_HANDLER \
+  { "hurd", fh_nothing}, \
+  { "hwaddr?", system_fh_hwaddr_query}, \
+  { "hwaddr", system_fh_hwaddr}, \
+  { "hwtype?", system_fh_hwtype_query}, \
+  { "hwtype", system_fh_hwtype},
+
+void system_fh_hwaddr_query (format_data_t form, int argc, char *argv[]);
+void system_fh_hwaddr (format_data_t form, int argc, char *argv[]);
+void system_fh_hwtype_query (format_data_t form, int argc, char *argv[]);
+void system_fh_hwtype (format_data_t form, int argc, char *argv[]);
+
+#endif /* !IFCONFIG_SYSTEM_HURD_H */
--
2.23.0.rc1.170.gbd704faa3e

From 589dab9c7d3119da82837dabae34c8a3d16cbe49 Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <gnu@gisladisker.se>
Date: Thu, 30 Jul 2015 01:06:42 +0200
Subject: [PATCH 07/35] ifconfig: Hardware detection in GNU/Hurd.

A work-around needed to distinguish hardware type.
---
 ChangeLog              | 10 ++++++++++
 ifconfig/system/hurd.c | 19 ++++++++++++-------
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
index 3bd19775..b6261a00 100644
--- a/ifconfig/system/hurd.c
+++ b/ifconfig/system/hurd.c
@@ -175,6 +175,16 @@ print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
   had_output = 1;
 }

+/* GNU/Hurd and Mach are using a mixture of BSD definitions
+ * and GNU/Linux interface headers, which in this situation
+ * means that sa_family_t is an unsigned char, from BSD, while
+ * all ARPHRD_* come from GNU/Linux and are thus 16 bits wide.
+ * We must account for this.  The following bitmask will
+ * adapt to any future change!
+ */
+
+#define _ARP_MASK ((sizeof (sa_family_t) == 1) ? 0xff : 0xffff)
+
 struct arphrd_symbol
 {
   const char *name;
@@ -184,16 +194,11 @@ struct arphrd_symbol
 } arphrd_symbols[] =
   {
 #ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
-    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
+    { "ETHER", "Ethernet", ARPHRD_ETHER & _ARP_MASK, print_hwaddr_ether},
 #endif
 #ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
-    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK & _ARP_MASK, NULL},
 #endif
-    /* XXX: The image debian-hurd-20150424 returns the value 4
-	    instead of expected ARPHRD_LOOPBACK.  This has been
-	    discussed in the list debian-hurd, where I was asked
-	    to resist the temptation of a work around!
-     */
     { NULL, NULL, 0, NULL}
   };

--
2.23.0.rc1.170.gbd704faa3e

From d379784b4461d17b2536effd1b52bae21cd28a32 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Fri, 16 Aug 2019 00:34:03 +0200
Subject: [PATCH 35/35] telnet: Several ioctls have been disabled in the Hurd's
 glibc

But not the related option macros. inetutils uses those macros to decide
whether the ioctls are available, so it is FTBFS now. The Hurd's glibc
is being fixed, but we'll use this for now to get the builds going.
---
 telnet/sys_bsd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
index 662536ab..5eb35cb5 100644
--- a/telnet/sys_bsd.c
+++ b/telnet/sys_bsd.c
@@ -63,6 +63,7 @@
 #include <errno.h>
 #include <arpa/telnet.h>
 #include <sys/select.h>
+#include <sys/ioctl.h>
 #include <unused-parameter.h>

 #include "ring.h"
@@ -157,7 +158,7 @@ TerminalRead (char *buf, int n)
 int
 TerminalAutoFlush (void)
 {
-#if defined LNOFLSH
+#if defined TIOCLGET && defined LNOFLSH
   int flush;

   ioctl (0, TIOCLGET, (char *) &flush);
@@ -260,7 +261,9 @@ TerminalSaveState (void)
   ioctl (0, TIOCGETP, (char *) &ottyb);
   ioctl (0, TIOCGETC, (char *) &otc);
   ioctl (0, TIOCGLTC, (char *) &oltc);
+#ifdef TIOCLGET
   ioctl (0, TIOCLGET, (char *) &olmode);
+#endif

   ntc = otc;
   nltc = oltc;
@@ -755,7 +758,9 @@ TerminalNewMode (register int f)
 #endif
     }
 #ifndef USE_TERMIO
+#ifdef TIOCLSET
   ioctl (tin, TIOCLSET, (char *) &lmode);
+#endif
   ioctl (tin, TIOCSLTC, (char *) &ltc);
   ioctl (tin, TIOCSETC, (char *) &tc);
   ioctl (tin, TIOCSETN, (char *) &sb);
--
2.23.0.rc1.170.gbd704faa3e


code:
This patch adds support for Poppler 0.76 and later.

Taken from upstream:
<https://gitlab.com/inkscape/inkscape/commit/e831b034746f8dc3c3c1b88372751f6dcb974831>

diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 8484984bdf..4f798e35bf 100644
--- a/src/extension/internal/pdfinput/pdf-parser.cpp
+++ b/src/extension/internal/pdfinput/pdf-parser.cpp
@@ -421,7 +421,7 @@ void PdfParser::parse(Object *obj, GBool topLevel) {
 	error(errInternal, -1, "Weird page contents");
     	return;
   }
-  parser = new Parser(xref, new Lexer(xref, obj), gFalse);
+  parser = new _POPPLER_NEW_PARSER(xref, obj);
   go(topLevel);
   delete parser;
   parser = nullptr;
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
index 61a15083a0..5e8bc4ae90 100644
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
@@ -14,6 +14,13 @@

 #include <glib/poppler-features.h>

+#if POPPLER_CHECK_VERSION(0, 76, 0)
+#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse)
+#else
+#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse)
+#endif
+
+
 #if POPPLER_CHECK_VERSION(0, 72, 0)
 #define getCString c_str
 #endif


code:
This patch removes sources of build non-determinism in the upstream sources.

In particular, many of the compiled sources are generated with Python code,
which in turn uses dictionaries to index the output C functions.  However,
iterators over Python dictionaries have no guaranteed order, thus resulting in
the C functions being output in a random order between builds.

The patch below fixes this by forcing an order during output in several key
places.  Note, however, that future updates may uncover new such places that
just happen to be non-problematic at the time of this patch.  If you are
reading this due to finding such issues, feel free to contact me at
elaexuotee@wilsonb.com for help.

diff --git a/pysrc/ild_codegen.py b/pysrc/ild_codegen.py
index 628ec45..a9bff79 100755
--- a/pysrc/ild_codegen.py
+++ b/pysrc/ild_codegen.py
@@ -188,14 +188,14 @@ def gen_l2_func_list(agi, target_nt_dict, arg_nt_dict,
                      ild_t_member):
     """generate L2 functions"""
     l2_func_list = []
-    for (nt_name,array) in target_nt_dict.items():
+    for (nt_name,array) in sorted(target_nt_dict.items()):
         target_opname = array.get_target_opname()
         if array.is_const_lookup_fun():
             fo = gen_const_l2_function(agi, nt_name,
                                 target_opname, ild_t_member)
             l2_func_list.append(fo)
         else:
-            for arg_nt_seq,arg_arr in arg_nt_dict.items():
+            for arg_nt_seq,arg_arr in sorted(arg_nt_dict.items()):
                 fo = gen_scalable_l2_function(agi, nt_name,
                      target_opname, ild_t_member, arg_arr, list(arg_nt_seq))
                 l2_func_list.append(fo)
diff --git a/pysrc/ild_disp.py b/pysrc/ild_disp.py
index 942c036..cf80e29 100755
--- a/pysrc/ild_disp.py
+++ b/pysrc/ild_disp.py
@@ -350,7 +350,8 @@ def work(agi, united_lookup,  disp_nts, brdisp_nts, ild_gendir,
     disp_dict = _gen_l3_array_dict(agi, disp_nts, _disp_token)

-    nt_arr_list = list(brdisp_dict.values()) + list(disp_dict.values())
+    nt_arr_list = ([v for (k,v) in sorted(brdisp_dict.items())] +
+                   [v for (k,v) in sorted(disp_dict.items())])
     #create function that calls all initialization functions
     init_f = ild_nt.gen_init_function(nt_arr_list, 'xed_ild_disp_l3_init')

@@ -367,7 +368,7 @@ def work(agi, united_lookup,  disp_nts, brdisp_nts, ild_gendir,
     l2_functions = []
     eosz_op = ild_eosz.get_target_opname()
     easz_op = ild_easz.get_target_opname()
-    for nt_name,array in list(disp_dict.items()) + list(brdisp_dict.items()):
+    for nt_name,array in sorted(disp_dict.items()) + sorted(brdisp_dict.items()):
         #Some DISP NTs depend on EOSZ, others on EASZ, we need to know
         #that when we generate L2 functions
         if eosz_op in array.get_arg_names():
diff --git a/pysrc/ild_easz.py b/pysrc/ild_easz.py
index 02cd691..c53b9f2 100755
--- a/pysrc/ild_easz.py
+++ b/pysrc/ild_easz.py
@@ -165,9 +165,10 @@ def work(agi, united_lookup, easz_nts, ild_gendir, debug):
             return
         nt_seq_arrays[tuple(nt_seq)] = array
     #init function calls all single init functions for the created tables
-    init_f = ild_nt.gen_init_function(list(nt_seq_arrays.values()),
+    nt_seq_values = [v for (k,v) in sorted(nt_seq_arrays.items())]
+    init_f = ild_nt.gen_init_function(nt_seq_values,
                                        'xed_ild_easz_init')
-    ild_nt.dump_lu_arrays(agi, list(nt_seq_arrays.values()), _easz_c_fn,
+    ild_nt.dump_lu_arrays(agi, nt_seq_values, _easz_c_fn,
                           mbuild.join('include-private', _easz_header_fn),
                           init_f)
     getter_fos = []
diff --git a/pysrc/ild_eosz.py b/pysrc/ild_eosz.py
index 6643bc3..89d2d89 100755
--- a/pysrc/ild_eosz.py
+++ b/pysrc/ild_eosz.py
@@ -200,10 +200,11 @@ def work(agi, united_lookup, eosz_nts, ild_gendir, debug):
             return None
         nt_seq_arrays[tuple(nt_seq)] = array
     #init function calls all single init functions for the created tables
-    init_f = ild_nt.gen_init_function(list(nt_seq_arrays.values()),
+    nt_seq_values = [v for (k,v) in sorted(nt_seq_arrays.items())]
+    init_f = ild_nt.gen_init_function(nt_seq_values,
                                       'xed_ild_eosz_init')
     #dump init and lookup functions for EOSZ sequences
-    ild_nt.dump_lu_arrays(agi, list(nt_seq_arrays.values()), _eosz_c_fn,
+    ild_nt.dump_lu_arrays(agi, nt_seq_values, _eosz_c_fn,
                           mbuild.join('include-private', _eosz_header_fn),
                           init_f)
     #generate EOSZ getter functions - they get xed_decoded_inst_t*
diff --git a/pysrc/ild_imm.py b/pysrc/ild_imm.py
index 51c413c..0530bae 100755
--- a/pysrc/ild_imm.py
+++ b/pysrc/ild_imm.py
@@ -322,12 +322,14 @@ def work(agi, united_lookup, imm_nts, ild_gendir, eosz_dict,
                                      level='l3')
         nt_dict[nt_name] = array

+    nt_dict_values = [v for (k,v) in sorted(nt_dict.items())]
+
     #create function that calls all initialization functions for L3
-    init_f = ild_nt.gen_init_function(list(nt_dict.values()),
+    init_f = ild_nt.gen_init_function(nt_dict_values,
                                       'xed_ild_imm_l3_init')

     #dump L3 functions
-    ild_nt.dump_lu_arrays(agi, list(nt_dict.values()), _l3_c_fn,
+    ild_nt.dump_lu_arrays(agi, nt_dict_values, _l3_c_fn,
                           mbuild.join('include-private',_l3_header_fn),
                           init_f)


code:
This patch fixes a regex parsing compatibility issue with Perl 5.26.0.
It manifests during the configure phase of at-spi2-core like this:

------
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at /gnu/store/...-intltool-0.51.0/bin/intltool-update line 1065.
------

Copied from Gentoo and MSYS2:

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-util/intltool/files/intltool-0.51.0-perl-5.26.patch?id=1105187fc65d8bf643e682fcef39620dcfd9326a
https://github.com/Alexpux/MSYS2-packages/blob/0d3f442553ae4fc8798e32cbf44c4252fa8f3c07/intltool/perl-5.22-compatibility.patch

#diff -ruN intltool-0.51.0.orig/intltool-update.in intltool-0.51.0/intltool-update.in
#--- intltool-0.51.0.orig/intltool-update.in	2017-06-28 00:47:20.889269294 +0200
#+++ intltool-0.51.0/intltool-update.in	2017-06-28 00:48:14.592271529 +0200
#@@ -1068,7 +1068,7 @@
# 	my $untouched = $1;
# 	my $sub = "";
#         # Ignore recursive definitions of variables
#-        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
#+        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\$\{?$2}?/;
#
# 	return SubstituteVariable ("$untouched$sub$rest");
#     }
--- intltool-0.51.0.orig/intltool-update.in	2015-03-09 02:39:54.000000000 +0100
+++ intltool-0.51.0.orig/intltool-update.in	2015-06-19 01:52:07.171228154 +0200
@@ -1062,7 +1062,7 @@
 	}
     }

-    if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
+    if ($str =~ /^(.*)\$\{?([A-Z_]+)}?(.*)$/)
     {
 	my $rest = $3;
 	my $untouched = $1;
@@ -1068,7 +1068,7 @@
 	my $untouched = $1;
 	my $sub = "";
         # Ignore recursive definitions of variables
-        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\${?$2}?/;
+        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ /\$\{?$2}?/;

 	return SubstituteVariable ("$untouched$sub$rest");
     }
@@ -1190,10 +1190,10 @@
 	$name    =~ s/\(+$//g;
 	$version =~ s/\(+$//g;

-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
     }

     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
@@ -1219,11 +1219,11 @@
 	$version =~ s/\(+$//g;
         $bugurl  =~ s/\(+$//g if (defined $bugurl);

-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
-        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
+	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME}?/);
+	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE}?/);
+	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION}?/);
+	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION}?/);
+        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+}?/);
     }

     # \s makes this not work, why?


code:
Fix name clash with libcap 2.29.

Taken from upstream:
https://github.com/iputils/iputils/commit/18f9a84e0e702841d6cc4d5f593de4fbd1348e83

diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
--- a/ninfod/ninfod.c
+++ b/ninfod/ninfod.c
@@ -455,7 +455,7 @@ static void do_daemonize(void)
 /* --------- */
 #ifdef HAVE_LIBCAP
 static const cap_value_t cap_net_raw = CAP_NET_RAW;
-static const cap_value_t cap_setuid =  CAP_SETUID;
+static const cap_value_t cap_setuserid = CAP_SETUID;
 static cap_flag_value_t cap_ok;
 #else
 static uid_t euid;
@@ -487,7 +487,7 @@ static void limit_capabilities(void)

 	cap_get_flag(cap_cur_p, CAP_SETUID, CAP_PERMITTED, &cap_ok);
 	if (cap_ok != CAP_CLEAR)
-		cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
+		cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);

 	if (cap_set_proc(cap_p) < 0) {
 		DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));
@@ -520,8 +520,8 @@ static void drop_capabilities(void)

 	/* setuid / setuid */
 	if (cap_ok != CAP_CLEAR) {
-		cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET);
-		cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuid, CAP_SET);
+		cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET);
+		cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuserid, CAP_SET);

 		if (cap_set_proc(cap_p) < 0) {
 			DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno));


code:
This patch is a combination of the two following patches with minor
changes to the install code
https://sources.debian.org/src/irrlicht/1.8.4+dfsg1-1/debian/patches/debian/link-against-needed-libs.diff/
https://sources.debian.org/src/irrlicht/1.8.4+dfsg1-1/debian/patches/debian/use-system-libs.diff/

---
 include/IrrCompileConfig.h                  | 26 +++++++++------------
 source/Irrlicht/CIrrDeviceLinux.h           |  2 +-
 source/Irrlicht/COpenGLExtensionHandler.h   |  8 +++----
 source/Irrlicht/COpenGLSLMaterialRenderer.h |  2 +-
 source/Irrlicht/Makefile                    | 15 ++++++------
 5 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h
index 6bb0589..2216353 100644
--- a/include/IrrCompileConfig.h
+++ b/include/IrrCompileConfig.h
@@ -238,6 +238,17 @@ for Windows based systems. You also have to set #define UNICODE for this to comp
 #undef _IRR_WCHAR_FILESYSTEM
 #endif

+//! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib.
+/** This enables the engine to read from compressed .zip archives. If you
+disable this feature, the engine can still read archives, but only uncompressed
+ones. */
+#define _IRR_COMPILE_WITH_ZLIB_
+
+//! Define _IRR_USE_NON_SYSTEM_ZLIB_ to let irrlicht use the zlib which comes with irrlicht.
+/** If this is commented out, Irrlicht will try to compile using the zlib installed in the system.
+	This is only used when _IRR_COMPILE_WITH_ZLIB_ is defined. */
+#undef _IRR_USE_NON_SYSTEM_ZLIB_
+
 //! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg.
 /** This enables the engine to read jpeg images. If you comment this out,
 the engine will no longer read .jpeg images. */
@@ -249,10 +260,7 @@ the engine will no longer read .jpeg images. */
 //! Define _IRR_USE_NON_SYSTEM_JPEG_LIB_ to let irrlicht use the jpeglib which comes with irrlicht.
 /** If this is commented out, Irrlicht will try to compile using the jpeg lib installed in the system.
 	This is only used when _IRR_COMPILE_WITH_LIBJPEG_ is defined. */
-#define _IRR_USE_NON_SYSTEM_JPEG_LIB_
-#ifdef NO_IRR_USE_NON_SYSTEM_JPEG_LIB_
 #undef _IRR_USE_NON_SYSTEM_JPEG_LIB_
-#endif

 //! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng.
 /** This enables the engine to read png images. If you comment this out,
@@ -265,10 +273,7 @@ the engine will no longer read .png images. */
 //! Define _IRR_USE_NON_SYSTEM_LIBPNG_ to let irrlicht use the libpng which comes with irrlicht.
 /** If this is commented out, Irrlicht will try to compile using the libpng installed in the system.
 	This is only used when _IRR_COMPILE_WITH_LIBPNG_ is defined. */
-#define _IRR_USE_NON_SYSTEM_LIB_PNG_
-#ifdef NO_IRR_USE_NON_SYSTEM_LIB_PNG_
 #undef _IRR_USE_NON_SYSTEM_LIB_PNG_
-#endif

 //! Define _IRR_D3D_NO_SHADER_DEBUGGING to disable shader debugging in D3D9
 /** If _IRR_D3D_NO_SHADER_DEBUGGING is undefined in IrrCompileConfig.h,
@@ -602,10 +607,7 @@ ones. */
 /** If this is commented out, Irrlicht will try to compile using the zlib
 installed on the system. This is only used when _IRR_COMPILE_WITH_ZLIB_ is
 defined. */
-#define _IRR_USE_NON_SYSTEM_ZLIB_
-#ifdef NO_IRR_USE_NON_SYSTEM_ZLIB_
 #undef _IRR_USE_NON_SYSTEM_ZLIB_
-#endif
 //! Define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ if you want to read AES-encrypted ZIP archives
 #define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_
 #ifdef NO_IRR_COMPILE_WITH_ZIP_ENCRYPTION_
@@ -623,18 +625,12 @@ library. */
 /** If this is commented out, Irrlicht will try to compile using the bzlib
 installed on the system. This is only used when _IRR_COMPILE_WITH_BZLIB_ is
 defined. */
-#define _IRR_USE_NON_SYSTEM_BZLIB_
-#ifdef NO_IRR_USE_NON_SYSTEM_BZLIB_
 #undef _IRR_USE_NON_SYSTEM_BZLIB_
-#endif
 //! Define _IRR_COMPILE_WITH_LZMA_ if you want to use LZMA compressed zip files.
 /** LZMA is a very efficient compression code, known from 7zip. Irrlicht
 currently only supports zip archives, though. */
-#define _IRR_COMPILE_WITH_LZMA_
-#ifdef NO_IRR_COMPILE_WITH_LZMA_
 #undef _IRR_COMPILE_WITH_LZMA_
 #endif
-#endif

 //! Define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ if you want to mount folders as archives
 #define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
diff --git a/source/Irrlicht/CIrrDeviceLinux.h b/source/Irrlicht/CIrrDeviceLinux.h
index 4d2a2c6..8cf24ba 100644
--- a/source/Irrlicht/CIrrDeviceLinux.h
+++ b/source/Irrlicht/CIrrDeviceLinux.h
@@ -22,7 +22,7 @@
 #define GLX_GLXEXT_LEGACY 1
 #include <GL/glx.h>
 #ifdef _IRR_OPENGL_USE_EXTPOINTER_
-#include "glxext.h"
+#include <GL/glxext.h>
 #endif
 #endif

diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h
index 1b77bad..3886a0e 100644
--- a/source/Irrlicht/COpenGLExtensionHandler.h
+++ b/source/Irrlicht/COpenGLExtensionHandler.h
@@ -35,7 +35,7 @@
 	#endif
 	#include <OpenGL/gl.h>
 	#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
-		#include "glext.h"
+		#include <GL/glext.h>
 	#endif
 #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
 	#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
@@ -48,7 +48,7 @@
 	#define NO_SDL_GLEXT
 	#include <SDL/SDL_video.h>
 	#include <SDL/SDL_opengl.h>
-	#include "glext.h"
+	#include <GL/glext.h>
 #else
 	#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
 		#define GL_GLEXT_LEGACY 1
@@ -60,9 +60,9 @@
 	#include <GL/gl.h>
 	#include <GL/glx.h>
 	#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
-	#include "glext.h"
+	#include <GL/glext.h>
 	#undef GLX_ARB_get_proc_address // avoid problems with local glxext.h
-	#include "glxext.h"
+	#include <GL/glxext.h>
 	#endif
 #endif

diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.h b/source/Irrlicht/COpenGLSLMaterialRenderer.h
index ff71150..f8a6007 100644
--- a/source/Irrlicht/COpenGLSLMaterialRenderer.h
+++ b/source/Irrlicht/COpenGLSLMaterialRenderer.h
@@ -25,7 +25,7 @@
 	#include <GL/gl.h>
 #endif
 #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
-	#include "glext.h"
+	#include <GL/glext.h>
 #endif
 #endif

diff --git a/source/Irrlicht/Makefile b/source/Irrlicht/Makefile
index 67a3899..d9ea7f3 100644
--- a/source/Irrlicht/Makefile
+++ b/source/Irrlicht/Makefile
@@ -43,7 +43,7 @@ IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CIm
 	CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o
 IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ)
 IRRSWRENDEROBJ = CSoftwareDriver.o CSoftwareTexture.o CTRFlat.o CTRFlatWire.o CTRGouraud.o CTRGouraudWire.o CTRNormalMap.o CTRStencilShadow.o CTRTextureFlat.o CTRTextureFlatWire.o CTRTextureGouraud.o CTRTextureGouraudAdd.o CTRTextureGouraudNoZ.o CTRTextureGouraudWire.o CZBuffer.o CTRTextureGouraudVertexAlpha2.o CTRTextureGouraudNoZ2.o CTRTextureLightMap2_M2.o CTRTextureLightMap2_M4.o CTRTextureLightMap2_M1.o CSoftwareDriver2.o CSoftwareTexture2.o CTRTextureGouraud2.o CTRGouraud2.o CTRGouraudAlpha2.o CTRGouraudAlphaNoZ2.o CTRTextureDetailMap2.o CTRTextureGouraudAdd2.o CTRTextureGouraudAddNoZ2.o CTRTextureWire2.o CTRTextureLightMap2_Add.o CTRTextureLightMapGouraud2_M4.o IBurningShader.o CTRTextureBlend.o CTRTextureGouraudAlpha.o CTRTextureGouraudAlphaNoZ.o CDepthBuffer.o CBurningShader_Raster_Reference.o
-IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CWADReader.o CZipReader.o CPakReader.o CNPKReader.o CTarReader.o CMountPointReader.o irrXML.o CAttributes.o lzma/LzmaDec.o
+IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CWADReader.o CZipReader.o CPakReader.o CNPKReader.o CTarReader.o CMountPointReader.o irrXML.o CAttributes.o
 IRROTHEROBJ = CIrrDeviceSDL.o CIrrDeviceLinux.o CIrrDeviceConsole.o CIrrDeviceStub.o CIrrDeviceWin32.o CIrrDeviceFB.o CLogger.o COSOperator.o Irrlicht.o os.o
 IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o CGUIImageList.o CGUITreeView.o
 ZLIBOBJ = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
@@ -56,14 +56,14 @@ BZIP2OBJ = bzip2/blocksort.o bzip2/huffman.o bzip2/crctable.o bzip2/randtable.o
 EXTRAOBJ =
 LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \
 	$(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) \
-	$(IRRGUIOBJ) $(ZLIBOBJ) $(JPEGLIBOBJ) $(LIBPNGOBJ) $(LIBAESGM) \
-	$(BZIP2OBJ) $(EXTRAOBJ)
+	$(IRRGUIOBJ) $(LIBAESGM) \
+	$(EXTRAOBJ)

 ###############
 #Compiler flags
-CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng
+CXXINCS = -I../../include # -Izlib -Ijpeglib -Ilibpng
 CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1
-CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
+CXXFLAGS += -Wall -pipe -fno-exceptions -fstrict-aliasing
 ifndef NDEBUG
 CXXFLAGS += -g -D_DEBUG
 else
@@ -88,7 +88,7 @@ STATIC_LIB = libIrrlicht.a
 LIB_PATH = ../../lib/$(SYSTEM)
 INSTALL_DIR = /usr/local/lib
 sharedlib install: SHARED_LIB = libIrrlicht.so
-sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
+staticlib sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lX11 -lz -lpng -ljpeg -lbz2
 staticlib sharedlib: CXXINCS += -I/usr/X11R6/include

 #OSX specific options
@@ -153,7 +153,8 @@ install install_osx:
 	$(RM) -r $(INSTALL_DIR)/../include/irrlicht
 	mkdir -p $(INSTALL_DIR)/../include/irrlicht
 	cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht/
-	cp $(LIB_PATH)/$(SHARED_FULLNAME) $(INSTALL_DIR)
+	cp $(LIB_PATH)/$(SHARED_FULLNAME) $(INSTALL_DIR) || true
+	cp $(LIB_PATH)/$(STATIC_LIB) $(INSTALL_DIR) || true
 	cd $(INSTALL_DIR) && ln -s -f $(SHARED_FULLNAME) $(SONAME)
 	cd $(INSTALL_DIR) && ln -s -f $(SONAME) $(SHARED_LIB)
 #	ldconfig -n $(INSTALL_DIR)
--
2.18.0


code:
Add aarch64 support to config.guess and config.sub, as would be found if using
a more recent version of autoconf.
---
 config.guess          |    7 +++++++
 config.sub            |    1 +
 2 files changed, 8 insertions(+)

diff --git a/config.guess b/config.guess
index 40eaed4..baad294 100755
--- a/config.guess
+++ b/config.guess
@@ -861,6 +861,13 @@ EOF
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
diff --git a/config.sub b/config.sub
index 30fdca8..8f5b018 100755
--- a/config.sub
+++ b/config.sub
@@ -247,6 +247,7 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
--
2.9.0


code:
Fix the broken Texinfo in the Jacal package documentation

--- jacal/jacal.texi,orig	2017-02-23 20:35:55.303980444 +0100
+++ jacal/jacal.texi	2017-02-23 20:53:14.539024674 +0100
@@ -343,7 +343,7 @@

 With the standard input grammar, the precedence of @samp{-} as a prefix
 behaves strangely.  @code{a^-b*c} becomes @code{a^(-b*c)} while
-@code{@result{a^b*c} (a^b)*c}.
+@code{a^b*c @result{} (a^b)*c}.

 Using @code{divide} to divide a polynomial by an integer does not work.

@@ -675,8 +675,9 @@
 e1: ---------
         a
 @end example
+@end deffn

-@deffnx Command suchthat var exp
+@deffn Command suchthat var exp

 If an expression rather than an equation is given to @code{suchthat}, it
 is as though the equation @code{@var{exp}=0} was given.
@@ -688,8 +689,9 @@
 e2: ---------
         a
 @end example
+@end deffn

-@deffnx Operator | var exp_or_eqn
+@deffn Operator | var exp_or_eqn

 An alternative infix notation is also available for @code{suchthat}.

@@ -857,8 +859,9 @@

 Returns the degree of polynomial or equation @var{poly} in variable
 @var{var}.
+@end deffn

-@deffnx Operator degree poly
+@deffn Operator degree poly

 Returns the total-degree, the degree of its highest degree monomial,
 of polynomial or equation @var{poly}.
@@ -1016,10 +1019,12 @@
 Returns @var{poly1} reduced with respect to @var{poly2} (or @var{eqn})
 and @var{var}.  If @var{poly2} is univariate, the third argument is not
 needed.
+@end deffn

-@deffnx Command mod poly1 n
+@deffn Command mod poly1 n
 Returns @var{poly1} with all the coefficients taken modulo @var{n}.
-@deffnx Command mod poly1
+@end deffn
+@deffn Command mod poly1
 Returns @var{poly1} with all the coefficients taken modulo the
 current modulus.

@@ -1220,8 +1225,9 @@
 e1: -1 2  3 5
 @end group
 @end example
+@end deffn

-@deffnx Command factor polyratio
+@deffn Command factor polyratio
 Given a univariate ratio of polynomials @var{polyratio}, returns a
 matrix of factors and exponents.

@@ -2028,7 +2034,7 @@
 formed from the pair-wise products of components of the inputs.  For
 example, for the input tensors @code{x[a,b]} and @code{y[c]}
 @example
-@result{z:tmult(x,y);} z[a,b,c] = x[a,b]*y[c]
+z:tmult(x,y); @result{} z[a,b,c] = x[a,b]*y[c]
 @end example

 With an additional argument, @code{tmult} will produce the inner product
@@ -2464,8 +2470,9 @@
 If you do not wish to return to Jacal but really want to terminate the
 session and return to the operating system, then after typing
 @code{qed();}, type @code{(slib:exit)} or use @code{quit}.
+@end deffn

-@deffnx Command quit
+@deffn Command quit
 Exit directly from Jacal to the operating system.  You will not be able
 to continue your Jacal session.


code:
From d80cfc83325f8e95d35ecd9f15b36b96fa9ed3ee Mon Sep 17 00:00:00 2001
From: Simon South <simon@simonsouth.net>
Date: Sat, 6 Jun 2020 18:56:56 -0400
Subject: [PATCH] Disable branch-patching

This patch disables JamVM's branch-patching optimization, which tends
to make JamVM fail with an "Illegal instruction" error on x86_64 (and
possibly other architectures that use variable-length instructions)
when built using modern versions of gcc and glibc.
---
 src/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/init.c b/src/init.c
index 32539cf..38ad54b 100644
--- a/src/init.c
+++ b/src/init.c
@@ -72,8 +72,8 @@ void setDefaultInitArgs(InitArgs *args) {
 #ifdef INLINING
     args->replication_threshold = 10;
     args->profile_threshold     = 10;
-    args->branch_patching_dup   = TRUE;
-    args->branch_patching       = TRUE;
+    args->branch_patching_dup   = FALSE;
+    args->branch_patching       = FALSE;
     args->print_codestats       = FALSE;
     args->join_blocks           = TRUE;
     args->profiling             = TRUE;
--
2.25.2


code:
From 67faeb7d58e0d25a50d36788ed49ed383b92e090 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Mon, 26 Mar 2018 11:08:17 +0300
Subject: [PATCH] add ARMv7 support

---
 src/arch/arm.h                           |  75 +++++-
 src/os/linux/arm/Makefile.am             |   9 +-
 src/os/linux/arm/Makefile.in             | 166 ++++++++----
 src/os/linux/arm/callNative.S            |  12 +-
 src/os/linux/arm/callNativeEABI.S        |   8 +-
 src/os/linux/arm/callNativeEABIHard.S    | 315 +++++++++++++++++++++++
 src/os/linux/arm/callNativeEABIHardARM.S | 266 +++++++++++++++++++
 src/os/linux/arm/dll_md.c                |  61 ++++-
 8 files changed, 843 insertions(+), 69 deletions(-)
 create mode 100644 src/os/linux/arm/callNativeEABIHard.S
 create mode 100644 src/os/linux/arm/callNativeEABIHardARM.S

diff --git a/src/arch/arm.h b/src/arch/arm.h
index ccf68c4..d2c0318 100644
--- a/src/arch/arm.h
+++ b/src/arch/arm.h
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007
- * Robert Lougher <rob@lougher.org.uk>.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+ * 2014 Robert Lougher <rob@jamvm.org.uk>.
  *
  * This file is part of JamVM.
  *
@@ -21,10 +21,16 @@

 #define OS_ARCH "arm"

-/* Override default min and max heap sizes.  ARM machines are
-   usually embedded, and the standard defaults are too large. */
-#define DEFAULT_MAX_HEAP 16*MB
+/* Override minimum min heap size.  The initial heap size is a ratio
+   of the physical memory, but it must be at least the minimum min
+   size.  The normal setting is too large for ARM machines as they
+   are usually embedded. */
+#define MIN_MIN_HEAP 1*MB
+
+/* Likewise, override the default min/max heap sizes used when the
+   size of physical memory is not available */
 #define DEFAULT_MIN_HEAP 1*MB
+#define DEFAULT_MAX_HEAP 64*MB

 #ifdef DIRECT
 #define HANDLER_TABLE_T static const void
@@ -51,6 +57,36 @@
 /* Needed for i386 -- empty here */
 #define FPU_HACK

+#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__)
+#define COMPARE_AND_SWAP_32(addr, old_val, new_val)       \
+({                                                        \
+    int result, read_val;                                 \
+    __asm__ __volatile__ ("                               \
+        1:      mov %0, #0;                               \
+                ldrex %1, [%2];                           \
+                cmp %3, %1;                               \
+                bne 2f;                                   \
+                strex %0, %4, [%2];                       \
+                cmp %0, #1;                               \
+                beq 1b;                                   \
+                mov %0, #1;                               \
+        2:"                                               \
+    : "=&r" (result), "=&r" (read_val)                    \
+    : "r" (addr), "r" (old_val), "r" (new_val)            \
+    : "cc", "memory");                                    \
+    result;                                               \
+})
+
+#define COMPARE_AND_SWAP(addr, old_val, new_val)          \
+        COMPARE_AND_SWAP_32(addr, old_val, new_val)
+
+#define LOCKWORD_READ(addr) *addr
+#define LOCKWORD_WRITE(addr, value) *addr = value
+#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
+        COMPARE_AND_SWAP(addr, old_val, new_val)
+
+#else
+
 #define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
 ({                                                        \
     int result, read_val;                                 \
@@ -94,7 +130,7 @@ do {                                                      \
     : "r" (addr), "r" (new_val)                           \
     : "cc", "memory");                                    \
 } while(0)
-
+#endif

 #ifdef __ARM_EABI__
 #define FLUSH_CACHE(addr, length)                         \
@@ -124,8 +160,33 @@ do {                                                      \
 }
 #endif

+#define GEN_REL_JMP(target_addr, patch_addr, patch_size)  \
+({                                                        \
+    int patched = FALSE;                                  \
+                                                          \
+    if(patch_size >= 4) {                                 \
+        /* Guard against the pointer difference being     \
+           larger than the signed range */                \
+        long long offset = (uintptr_t)(target_addr) -     \
+                           (uintptr_t)(patch_addr) - 8;   \
+                                                          \
+        if(offset >= -1<<25 && offset < 1<<25) {          \
+            *(int*)(patch_addr) = offset>>2 & 0x00ffffff  \
+                                            | 0xea000000; \
+            patched = TRUE;                               \
+        }                                                 \
+    }                                                     \
+    patched;                                              \
+})
+
+#ifdef __ARM_ARCH_7A__
+#define MBARRIER() __asm__ __volatile__ ("dmb" ::: "memory")
+#define UNLOCK_MBARRIER() __asm__ __volatile__ ("dmb" ::: "memory")
+#define JMM_LOCK_MBARRIER() __asm__ __volatile__ ("dmb" ::: "memory")
+#define JMM_UNLOCK_MBARRIER() __asm__ __volatile__ ("dmb" ::: "memory")
+#else
 #define MBARRIER() __asm__ __volatile__ ("" ::: "memory")
 #define UNLOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
 #define JMM_LOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
 #define JMM_UNLOCK_MBARRIER() __asm__ __volatile__ ("" ::: "memory")
-
+#endif
diff --git a/src/os/linux/arm/Makefile.am b/src/os/linux/arm/Makefile.am
index d18ea5a..74e7786 100644
--- a/src/os/linux/arm/Makefile.am
+++ b/src/os/linux/arm/Makefile.am
@@ -1,6 +1,6 @@
 ##
-## Copyright (C) 2003, 2004, 2005, 2006, 2007
-## Robert Lougher <rob@lougher.org.uk>.
+## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
+## Robert Lougher <rob@jamvm.org.uk>.
 ##
 ## This file is part of JamVM.
 ##
@@ -19,10 +19,11 @@
 ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ##

-EXTRA_DIST = callNativeOABI.S callNativeEABI.S
+EXTRA_DIST = callNativeOABI.S callNativeEABI.S callNativeEABIHard.S \
+             callNativeEABIHardARM.S

 noinst_LTLIBRARIES = libnative.la
 libnative_la_SOURCES = init.c dll_md.c callNative.S

-AM_CPPFLAGS = -I$(top_builddir)/src
+AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
 AM_CCASFLAGS = -I$(top_builddir)/src
diff --git a/src/os/linux/arm/Makefile.in b/src/os/linux/arm/Makefile.in
index 63b21ad..6d44ea9 100644
--- a/src/os/linux/arm/Makefile.in
+++ b/src/os/linux/arm/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@

 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,9 +16,27 @@
 @SET_MAKE@

 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -42,13 +61,15 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/src/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libnative_la_LIBADD =
 am_libnative_la_OBJECTS = init.lo dll_md.lo callNative.lo
 libnative_la_OBJECTS = $(am_libnative_la_OBJECTS)
-DEFAULT_INCLUDES = -I. -I$(top_builddir)/src@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
 LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -65,6 +86,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libnative_la_SOURCES)
 DIST_SOURCES = $(libnative_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -84,21 +110,18 @@ CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
-ECHO = @ECHO@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -106,21 +129,30 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 JAVAC = @JAVAC@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 RANLIB = @RANLIB@
@@ -133,9 +165,9 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -149,6 +181,7 @@ build_cpu = @build_cpu@
 build_os = @build_os@
 build_vendor = @build_vendor@
 builddir = @builddir@
+classlib = @classlib@
 datadir = @datadir@
 datarootdir = @datarootdir@
 docdir = @docdir@
@@ -181,15 +214,18 @@ sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 use_zip_no = @use_zip_no@
 use_zip_yes = @use_zip_yes@
 with_classpath_install_dir = @with_classpath_install_dir@
-EXTRA_DIST = callNativeOABI.S callNativeEABI.S
+EXTRA_DIST = callNativeOABI.S callNativeEABI.S callNativeEABIHard.S \
+             callNativeEABIHardARM.S
+
 noinst_LTLIBRARIES = libnative.la
 libnative_la_SOURCES = init.c dll_md.c callNative.S
-AM_CPPFLAGS = -I$(top_builddir)/src
+AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
 AM_CCASFLAGS = -I$(top_builddir)/src
 all: all-am

@@ -199,14 +235,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/os/linux/arm/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/os/linux/arm/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/os/linux/arm/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/os/linux/arm/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -224,6 +260,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):

 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@@ -233,7 +270,7 @@ clean-noinstLTLIBRARIES:
 	  echo "rm -f \"$${dir}/so_locations\""; \
 	  rm -f "$${dir}/so_locations"; \
 	done
-libnative.la: $(libnative_la_OBJECTS) $(libnative_la_DEPENDENCIES)
+libnative.la: $(libnative_la_OBJECTS) $(libnative_la_DEPENDENCIES) $(EXTRA_libnative_la_DEPENDENCIES)
 	$(LINK)  $(libnative_la_OBJECTS) $(libnative_la_LIBADD) $(LIBS)

 mostlyclean-compile:
@@ -248,42 +285,42 @@ distclean-compile:

 .S.o:
 @am__fastdepCCAS_TRUE@	$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCCAS_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCCAS_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCCAS_FALSE@	$(CPPASCOMPILE) -c -o $@ $<

 .S.obj:
 @am__fastdepCCAS_TRUE@	$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCCAS_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCCAS_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCCAS_FALSE@	$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`

 .S.lo:
 @am__fastdepCCAS_TRUE@	$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCCAS_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCCAS_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCCAS_FALSE@	DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCCAS_FALSE@	$(LTCPPASCOMPILE) -c -o $@ $<

 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<

 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
@@ -299,45 +336,49 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS

 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
-	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '    { files[$$0] = 1; } \
-	       END { for (i in files) print i; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique

 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"

 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -358,13 +399,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -382,16 +427,22 @@ install-am: all-am

 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:

 clean-generic:

 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -413,6 +464,8 @@ dvi-am:

 html: html-am

+html-am:
+
 info: info-am

 info-am:
@@ -421,18 +474,28 @@ install-data-am:

 install-dvi: install-dvi-am

+install-dvi-am:
+
 install-exec-am:

 install-html: install-html-am

+install-html-am:
+
 install-info: install-info-am

+install-info-am:
+
 install-man:

 install-pdf: install-pdf-am

+install-pdf-am:
+
 install-ps: install-ps-am

+install-ps-am:
+
 installcheck-am:

 maintainer-clean: maintainer-clean-am
@@ -470,6 +533,7 @@ uninstall-am:
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
 	pdf pdf-am ps ps-am tags uninstall uninstall-am

+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/src/os/linux/arm/callNative.S b/src/os/linux/arm/callNative.S
index 39ab6d3..245afd1 100644
--- a/src/os/linux/arm/callNative.S
+++ b/src/os/linux/arm/callNative.S
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007
- * Robert Lougher <rob@lougher.org.uk>.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011, 2012
+ * Robert Lougher <rob@jamvm.org.uk>.
  *
  * This file is part of JamVM.
  *
@@ -23,7 +23,15 @@

 #ifndef USE_FFI
 #ifdef __ARM_EABI__
+#ifdef __ARM_PCS_VFP
+#ifdef __ARM_ARCH_7A__
+#include "callNativeEABIHard.S"
+#else
+#include "callNativeEABIHardARM.S"
+#endif
+#else
 #include "callNativeEABI.S"
+#endif
 #else
 #include "callNativeOABI.S"
 #endif
diff --git a/src/os/linux/arm/callNativeEABI.S b/src/os/linux/arm/callNativeEABI.S
index 5effa57..3a7539e 100644
--- a/src/os/linux/arm/callNativeEABI.S
+++ b/src/os/linux/arm/callNativeEABI.S
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007
- * Robert Lougher <rob@lougher.org.uk>.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011
+ * Robert Lougher <rob@jamvm.org.uk>.
  *
  * This file is part of JamVM.
  *
@@ -95,8 +95,12 @@ done:
         ldmfd   sp!, {r2, r3}

         /* Call the function */
+#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
         mov     lr, pc
         bx      ip
+#else
+        blx     ip
+#endif

         subs    r4, r4, #8              /* Pop argument area */
                                         /* (minus 8 for r2/r3) */
diff --git a/src/os/linux/arm/callNativeEABIHard.S b/src/os/linux/arm/callNativeEABIHard.S
new file mode 100644
index 0000000..5d5785b
--- /dev/null
+++ b/src/os/linux/arm/callNativeEABIHard.S
@@ -0,0 +1,315 @@
+/*
+ * Copyright (C) 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
+ *
+ * This file is part of JamVM.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+        .text
+        .syntax unified
+        .arch armv7-a
+        .thumb
+        .align  2
+        .global callJNIMethod
+        .type   callJNIMethod,function
+
+/*
+ * Arguments passed in:
+ *
+ * r0 JNIEnv
+ * r1 class or NULL
+ * r2 sig
+ * r3 extra arg
+ * sp + 0 ostack
+ * sp + 4 function pntr
+ * sp + 8 args count
+ */
+
+/* Register usage :
+ *
+ * r11 function pntr
+ * lr ostack pntr
+ * ip args pntr
+ * r8 sig pntr
+ * r10 extra stack
+ * r6 fp backfill
+ * r4 fp reg
+ * r7 int reg
+ * r5 scratch
+ * r3, r2 outgoing int args
+ * r1 outgoing class or this pntr
+ * r0 outgoing JNIEnv (as passed in)
+ *
+ * s0 - s16 (d0 - d7) outgoing float args
+ */
+
+callJNIMethod:
+        stmfd   sp!, {r4, r5, r6, r7, r8, r10, r11, lr}
+        ldr     lr, [sp, #32]           /* get ostack pntr */
+        ldr     r11, [sp, #36]          /* get function pntr */
+
+        cmp     r1, #0                  /* is method non-static? */
+        it      eq
+        ldreq   r1, [lr], #4            /* yes, load r1 with "this" */
+
+        mov     r10, r3
+        subs    sp, sp, r3              /* allocate room for stacked */
+        add     r8, r2, #1              /* init sig pntr -- skipping '(' */
+
+        mov     ip, sp                  /* init loop pntr */
+
+        mov     r7, #2
+        mov     r4, #16
+        mov     r6, #0
+
+scan_sig:
+        ldrb    r5, [r8], #1
+
+        cmp     r5, #41                 /* ')' */
+        beq     done
+
+        cmp     r5, #70                 /* 'F' */
+        beq     float
+
+        cmp     r5, #68                 /* 'D' */
+        beq     double
+
+        cmp     r5, #74                 /* 'J' */
+        beq     long
+
+skip_brackets:
+        cmp     r5, #91                 /* '[' */
+        itt     eq
+        ldrbeq  r5, [r8], #1
+        beq     skip_brackets
+
+        cmp     r5, #76                 /* 'L' */
+        bne     int
+
+skip_ref:
+        ldrb    r5, [r8], #1
+        cmp     r5, #59                 /* ';' */
+        bne     skip_ref
+
+int:
+        cbz     r7, stack_int
+
+        subs    r7, r7, #1
+        ite     ne
+        ldrne   r2, [lr], #4
+        ldreq   r3, [lr], #4
+
+        b       scan_sig
+
+float:
+        cbz     r6, no_backfill
+
+        sub     r5, r6, #1
+        mov     r6, #0
+        b       load_float
+
+no_backfill:
+        cbz     r4, stack_int
+
+        sub     r4, r4, #1
+        mov     r5, r4
+
+load_float:
+        add     lr, lr, #4
+        tbb     [pc, r5]
+
+float_table:
+        .byte (s15-float_table)/2
+        .byte (s14-float_table)/2
+        .byte (s13-float_table)/2
+        .byte (s12-float_table)/2
+        .byte (s11-float_table)/2
+        .byte (s10-float_table)/2
+        .byte (s9-float_table)/2
+        .byte (s8-float_table)/2
+        .byte (s7-float_table)/2
+        .byte (s6-float_table)/2
+        .byte (s5-float_table)/2
+        .byte (s4-float_table)/2
+        .byte (s3-float_table)/2
+        .byte (s2-float_table)/2
+        .byte (s1-float_table)/2
+        .byte (s0-float_table)/2
+
+stack_int:
+        ldr     r5, [lr], #4
+        str     r5, [ip], #4
+        b       scan_sig
+
+s0:
+        vldr    s0, [lr, #-4]
+        b       scan_sig
+s1:
+        vldr    s1, [lr, #-4]
+        b       scan_sig
+s2:
+        vldr    s2, [lr, #-4]
+        b       scan_sig
+s3:
+        vldr    s3, [lr, #-4]
+        b       scan_sig
+s4:
+        vldr    s4, [lr, #-4]
+        b       scan_sig
+s5:
+        vldr    s5, [lr, #-4]
+        b       scan_sig
+s6:
+        vldr    s6, [lr, #-4]
+        b       scan_sig
+s7:
+        vldr    s7, [lr, #-4]
+        b       scan_sig
+s8:
+        vldr    s8, [lr, #-4]
+        b       scan_sig
+s9:
+        vldr    s9, [lr, #-4]
+        b       scan_sig
+s10:
+        vldr    s10, [lr, #-4]
+        b       scan_sig
+s11:
+        vldr    s11, [lr, #-4]
+        b       scan_sig
+s12:
+        vldr    s12, [lr, #-4]
+        b       scan_sig
+s13:
+        vldr    s13, [lr, #-4]
+        b       scan_sig
+s14:
+        vldr    s14, [lr, #-4]
+        b       scan_sig
+s15:
+        vldr    s15, [lr, #-4]
+        b       scan_sig
+
+long:
+        cmp     r7, #2
+        mov     r7, #0
+        bne     stack_long
+
+        ldmia   lr!, {r2, r3}
+        b       scan_sig
+
+double:
+        lsrs    r5, r4, #1
+        it      cs
+        movcs   r6, r4
+
+        lsls    r4, r5, #1
+        beq     stack_double
+
+        sub     r4, r4, #2
+        add     lr, lr, #8
+        tbb     [pc, r5]
+
+double_table:
+        .byte 0
+        .byte (d7-double_table)/2
+        .byte (d6-double_table)/2
+        .byte (d5-double_table)/2
+        .byte (d4-double_table)/2
+        .byte (d3-double_table)/2
+        .byte (d2-double_table)/2
+        .byte (d1-double_table)/2
+        .byte (d0-double_table)/2
+        .align 2
+d0:
+        vldr    d0, [lr, #-8]
+        b       scan_sig
+d1:
+        vldr    d1, [lr, #-8]
+        b       scan_sig
+d2:
+        vldr    d2, [lr, #-8]
+        b       scan_sig
+d3:
+        vldr    d3, [lr, #-8]
+        b       scan_sig
+d4:
+        vldr    d4, [lr, #-8]
+        b       scan_sig
+d5:
+        vldr    d5, [lr, #-8]
+        b       scan_sig
+d6:
+        vldr    d6, [lr, #-8]
+        b       scan_sig
+d7:
+        vldr    d7, [lr, #-8]
+        b       scan_sig
+
+stack_double:
+        mov     r6, #0
+
+stack_long:
+        /* Ensure address is 8 byte aligned */
+        add     ip, ip, #7
+        bic     ip, ip, #7
+
+        ldr     r5, [lr], #4
+        str     r5, [ip], #4
+        ldr     r5, [lr], #4
+        str     r5, [ip], #4
+        b       scan_sig
+
+done:
+        /* Call the function */
+        blx     r11
+
+        add     sp, sp, r10             /* Pop argument area */
+
+        ldr     r4, [sp, #32]           /* Reload ostack for */
+                                        /* address of return value */
+
+        ldrb    r5, [r8]                /* Return type */
+
+        cmp     r5, #86                 /* 'V' */
+        beq     return
+
+        cmp     r5, #68                 /* 'D' */
+        beq     return_double
+
+        cmp     r5, #70                 /* 'F' */
+        beq     return_float
+
+        str     r0, [r4], #4            /* Low word */
+
+        cmp     r5, #74                 /* 'J' */
+        it      eq
+        streq   r1, [r4], #4            /* High word */
+
+return:
+        mov     r0, r4                  /* return ostack */
+        ldmfd   sp!, {r4, r5, r6, r7, r8, r10, r11, lr}
+        bx      lr
+
+return_float:
+        vstr    s0, [r4]
+        add     r4, r4, #4
+        b       return
+
+return_double:
+        vstr    d0, [r4]
+        add     r4, r4, #8
+        b       return
diff --git a/src/os/linux/arm/callNativeEABIHardARM.S b/src/os/linux/arm/callNativeEABIHardARM.S
new file mode 100644
index 0000000..3a31acd
--- /dev/null
+++ b/src/os/linux/arm/callNativeEABIHardARM.S
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
+ *
+ * This file is part of JamVM.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+        .text
+        .align  2
+        .global callJNIMethod
+        .type   callJNIMethod,function
+
+/*
+ * Arguments passed in:
+ *
+ * r0 JNIEnv
+ * r1 class or NULL
+ * r2 sig
+ * r3 extra arg
+ * sp + 0 ostack
+ * sp + 4 function pntr
+ * sp + 8 args count
+ */
+
+/* Register usage :
+ *
+ * lr ostack pntr
+ * ip scratch
+ * r11 function pntr
+ * r10 fp backfill
+ * r8 fp reg
+ * r7 int reg
+ * r6 args pntr
+ * r5 sig pntr
+ * r4 extra stack
+ * r3, r2 outgoing int args
+ * r1 outgoing class or this pntr
+ * r0 outgoing JNIEnv (as passed in)
+ *
+ * s0 - s16 (d0 - d7) outgoing float args
+ */
+
+callJNIMethod:
+        stmfd   sp!, {r4, r5, r6, r7, r8, r10, r11, lr}
+        ldr     lr, [sp, #32]           /* get ostack pntr */
+        ldr     r11, [sp, #36]          /* get function pntr */
+
+        cmp     r1, #0                  /* is method non-static? */
+        ldreq   r1, [lr], #4            /* yes, load r1 with "this" */
+
+        mov     r4, r3
+        sub     sp, sp, r4              /* allocate room for stacked */
+        add     r5, r2, #1              /* init sig pntr -- skipping '(' */
+
+        mov     r6, sp                  /* init loop pntr */
+
+        mov     r7, #2
+        mov     r8, #16
+        mov     r10, #0
+
+scan_sig:
+        ldrb    ip, [r5], #1
+
+        cmp     ip, #41                 /* ')' */
+        beq     done
+
+        cmp     ip, #70                 /* 'F' */
+        beq     float
+
+        cmp     ip, #68                 /* 'D' */
+        beq     double
+
+        cmp     ip, #74                 /* 'J' */
+        beq     long
+
+skip_brackets:
+        cmp     ip, #91                 /* '[' */
+        ldreqb  ip, [r5], #1
+        beq     skip_brackets
+
+        cmp     ip, #76                 /* 'L' */
+        bne     int
+
+skip_ref:
+        ldrb    ip, [r5], #1
+        cmp     ip, #59                 /* ';' */
+        bne     skip_ref
+
+int:
+        cmp     r7, #0
+        beq     stack_int
+
+        subs    r7, r7, #1
+
+        ldrne   r2, [lr], #4
+        ldreq   r3, [lr], #4
+
+        b       scan_sig
+
+stack_int:
+        ldr     ip, [lr], #4
+        str     ip, [r6], #4
+        b       scan_sig
+
+float:
+        cmp     r10, #0
+        beq     no_backfill
+
+        sub     ip, r10, #1
+        mov     r10, #0
+        b       load_float
+
+no_backfill:
+        cmp     r8, #0
+        beq     stack_int
+
+        sub     r8, r8, #1
+        mov     ip, r8
+
+load_float:
+        add     lr, lr, #4
+        add     pc, pc, ip, lsl #3
+        nop
+
+        flds    s15, [lr, #-4]
+        b       scan_sig
+        flds    s14, [lr, #-4]
+        b       scan_sig
+        flds    s13, [lr, #-4]
+        b       scan_sig
+        flds    s12, [lr, #-4]
+        b       scan_sig
+        flds    s11, [lr, #-4]
+        b       scan_sig
+        flds    s10, [lr, #-4]
+        b       scan_sig
+        flds    s9, [lr, #-4]
+        b       scan_sig
+        flds    s8, [lr, #-4]
+        b       scan_sig
+        flds    s7, [lr, #-4]
+        b       scan_sig
+        flds    s6, [lr, #-4]
+        b       scan_sig
+        flds    s5, [lr, #-4]
+        b       scan_sig
+        flds    s4, [lr, #-4]
+        b       scan_sig
+        flds    s3, [lr, #-4]
+        b       scan_sig
+        flds    s2, [lr, #-4]
+        b       scan_sig
+        flds    s1, [lr, #-4]
+        b       scan_sig
+        flds    s0, [lr, #-4]
+        b       scan_sig
+
+long:
+        cmp     r7, #2
+        mov     r7, #0
+        bne     stack_long
+
+        ldr     r2, [lr], #4
+        ldr     r3, [lr], #4
+        b       scan_sig
+
+double:
+        lsrs    ip, r8, #1
+        movcs   r10, r8
+
+        lsls    r8, ip, #1
+        beq     stack_double
+
+        sub     r8, r8, #2
+        add     lr, lr, #8
+        add     pc, pc, ip, lsl #3
+        nop
+        nop
+        nop
+
+        fldd    d7, [lr, #-8]
+        b       scan_sig
+        fldd    d6, [lr, #-8]
+        b       scan_sig
+        fldd    d5, [lr, #-8]
+        b       scan_sig
+        fldd    d4, [lr, #-8]
+        b       scan_sig
+        fldd    d3, [lr, #-8]
+        b       scan_sig
+        fldd    d2, [lr, #-8]
+        b       scan_sig
+        fldd    d1, [lr, #-8]
+        b       scan_sig
+        fldd    d0, [lr, #-8]
+        b       scan_sig
+
+stack_double:
+        mov     r10, #0
+
+stack_long:
+        /* Ensure address is 8 byte aligned */
+        add     r6, r6, #7
+        bic     r6, r6, #7
+
+        ldr     ip, [lr], #4
+        str     ip, [r6], #4
+        ldr     ip, [lr], #4
+        str     ip, [r6], #4
+        b       scan_sig
+
+done:
+        /* Call the function */
+#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
+        mov     lr, pc
+        bx      r11
+#else
+        blx     r11
+#endif
+
+        add     sp, sp, r4              /* Pop argument area */
+        ldr     r4, [sp, #32]           /* Reload ostack for */
+                                        /* address of return value */
+        ldrb    ip, [r5]                /* Return type */
+
+        cmp     ip, #86                 /* 'V' */
+        beq     return
+
+        cmp     ip, #68                 /* 'D' */
+        beq     return_double
+
+        cmp     ip, #70                 /* 'F' */
+        beq     return_float
+
+        str     r0, [r4], #4            /* Low word */
+
+        cmp     ip, #74                 /* 'J' */
+        streq   r1, [r4], #4            /* High word */
+
+return:
+        mov     r0, r4                  /* return ostack */
+        ldmfd   sp!, {r4, r5, r6, r7, r8, r10, r11, lr}
+        bx      lr
+
+return_float:
+        add     r4, r4, #4
+        fsts    s0, [r4, #-4]
+        b       return
+
+return_double:
+        add     r4, r4, #8
+        fstd    d0, [r4, #-8]
+        b       return
diff --git a/src/os/linux/arm/dll_md.c b/src/os/linux/arm/dll_md.c
index f5df90e..39bdf7c 100644
--- a/src/os/linux/arm/dll_md.c
+++ b/src/os/linux/arm/dll_md.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006, 2007
- * Robert Lougher <rob@lougher.org.uk>.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011
+ * Robert Lougher <rob@jamvm.org.uk>.
  *
  * This file is part of JamVM.
  *
@@ -31,6 +31,61 @@
  * out stack requirements and then to push arguments.  To
  * save the first scan at call time, the signature is pre-
  * scanned and stack requirement stored in the extra argument. */
+
+#ifdef __ARM_PCS_VFP
+int nativeExtraArg(MethodBlock *mb) {
+    char *sig = mb->type;
+    int fp_backfill = 0;
+    int stack_args = 0;
+    int int_args = 2;
+    int fp_args = 16;
+
+    while(*++sig != ')')
+        switch(*sig) {
+            case 'J':
+                if(int_args < 2)
+                    stack_args = (stack_args + 15) & ~7;
+                int_args = 0;
+                break;
+
+            case 'D':
+                fp_backfill |= fp_args & 1;
+                fp_args &= ~1;
+
+                if(fp_args == 0) {
+                    stack_args = (stack_args + 15) & ~7;
+                    fp_backfill = 0;
+                } else
+                    fp_args -= 2;
+                break;
+
+            case 'F':
+                if(fp_backfill)
+                    fp_backfill = 0;
+                else {
+                    if(fp_args == 0)
+                        stack_args += 4;
+                    else
+                        fp_args--;
+                }
+                break;
+
+            default:
+                if(int_args == 0)
+                    stack_args += 4;
+                else
+                    int_args--;
+
+                if(*sig == '[')
+                    while(*++sig == '[');
+                if(*sig == 'L')
+                    while(*++sig != ';');
+                break;
+        }
+
+    return (stack_args + 7) & ~7;
+}
+#else
 int nativeExtraArg(MethodBlock *mb) {
     char *sig = mb->type;
     int args = 0;
@@ -57,7 +112,7 @@ int nativeExtraArg(MethodBlock *mb) {
        native method, so minimum stack requirement is 8 bytes. */
     return args < 8 ? 8 : args;
 }
-
+#endif
 #else

 /* Under OABI, arguments can be copied onto the stack "as is"
--
2.17.1


code:
From 29055a825af5405e44ffcd59a776f8952bdc7203 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Fri, 15 Dec 2017 16:03:23 +0100
Subject: [PATCH] Port to latest bouncycastle.

---
 .../bouncycastle/OpenPGPSignatureGenerator.java    | 34 ++++++++++------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java b/src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java
index af7beae..34c204f 100644
--- a/src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java
+++ b/src/java/org/apache/ivy/plugins/signer/bouncycastle/OpenPGPSignatureGenerator.java
@@ -41,6 +41,11 @@ import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
 import org.bouncycastle.openpgp.PGPSignature;
 import org.bouncycastle.openpgp.PGPSignatureGenerator;
 import org.bouncycastle.openpgp.PGPUtil;
+import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
+import org.bouncycastle.openpgp.operator.bc.BcPBESecretKeyDecryptorBuilder;
+import org.bouncycastle.openpgp.operator.bc.BcPGPDigestCalculatorProvider;
+import org.bouncycastle.openpgp.operator.bc.BcPGPContentSignerBuilder;
+import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;

 public class OpenPGPSignatureGenerator implements SignatureGenerator {

@@ -101,11 +106,15 @@ public class OpenPGPSignatureGenerator implements SignatureGenerator {
                 pgpSec = readSecretKey(keyIn);
             }

-            PGPPrivateKey pgpPrivKey = pgpSec.extractPrivateKey(password.toCharArray(),
-                BouncyCastleProvider.PROVIDER_NAME);
-            PGPSignatureGenerator sGen = new PGPSignatureGenerator(pgpSec.getPublicKey()
-                    .getAlgorithm(), PGPUtil.SHA1, BouncyCastleProvider.PROVIDER_NAME);
-            sGen.initSign(PGPSignature.BINARY_DOCUMENT, pgpPrivKey);
+            PBESecretKeyDecryptor decryptor =
+                    new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider())
+                    .build(password.toCharArray());
+            PGPPrivateKey pgpPrivKey = pgpSec.extractPrivateKey(decryptor);
+            BcPGPContentSignerBuilder builder = new BcPGPContentSignerBuilder(
+                            pgpSec.getPublicKey().getAlgorithm(), PGPUtil.SHA1);
+
+            PGPSignatureGenerator sGen = new PGPSignatureGenerator(builder);
+            sGen.init(PGPSignature.BINARY_DOCUMENT, pgpPrivKey);

             in = new FileInputStream(src);
             out = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(dest)));
@@ -116,22 +125,10 @@ public class OpenPGPSignatureGenerator implements SignatureGenerator {
             }

             sGen.generate().encode(out);
-        } catch (SignatureException e) {
-            IOException ioexc = new IOException();
-            ioexc.initCause(e);
-            throw ioexc;
         } catch (PGPException e) {
             IOException ioexc = new IOException();
             ioexc.initCause(e);
             throw ioexc;
-        } catch (NoSuchAlgorithmException e) {
-            IOException ioexc = new IOException();
-            ioexc.initCause(e);
-            throw ioexc;
-        } catch (NoSuchProviderException e) {
-            IOException ioexc = new IOException();
-            ioexc.initCause(e);
-            throw ioexc;
         } finally {
             if (out != null) {
                 try {
@@ -156,7 +153,8 @@ public class OpenPGPSignatureGenerator implements SignatureGenerator {

     private PGPSecretKey readSecretKey(InputStream in) throws IOException, PGPException {
         in = PGPUtil.getDecoderStream(in);
-        PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(in);
+        PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(in,
+                        new BcKeyFingerprintCalculator());

         PGPSecretKey key = null;
         for (Iterator it = pgpSec.getKeyRings(); key == null && it.hasNext();) {
--
2.15.1