[Pkg-gnupg-commit] r425 - in /libgpg-error/trunk/debian: changelog patches/hppa-lock-obj-tweak.patch

dkg at users.alioth.debian.org dkg at users.alioth.debian.org
Wed Aug 6 04:26:42 UTC 2014


Author: dkg
Date: Wed Aug  6 04:26:41 2014
New Revision: 425

URL: http://svn.debian.org/wsvn/pkg-gnupg/?sc=1&rev=425
Log:
use upstream's hppa fix

Werner Koch reviewed the changes and pushed a slight variant.  We
might as well use upstream's preferred variant instead of our own.

Modified:
    libgpg-error/trunk/debian/changelog
    libgpg-error/trunk/debian/patches/hppa-lock-obj-tweak.patch

Modified: libgpg-error/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnupg/libgpg-error/trunk/debian/changelog?rev=425&op=diff
==============================================================================
--- libgpg-error/trunk/debian/changelog	(original)
+++ libgpg-error/trunk/debian/changelog	Wed Aug  6 04:26:41 2014
@@ -1,3 +1,9 @@
+libgpg-error (1.13-2) unstable; urgency=medium
+
+  * adopt upstream's variant of the hppa tuning.
+
+ -- Daniel Kahn Gillmor <dkg at fifthhorseman.net>  Wed, 06 Aug 2014 00:22:25 -0400
+
 libgpg-error (1.13-1) unstable; urgency=medium
 
   * Adopt by pkg-gnupg team, after conferring with previous maintainer.  Thanks,

Modified: libgpg-error/trunk/debian/patches/hppa-lock-obj-tweak.patch
URL: http://svn.debian.org/wsvn/pkg-gnupg/libgpg-error/trunk/debian/patches/hppa-lock-obj-tweak.patch?rev=425&op=diff
==============================================================================
--- libgpg-error/trunk/debian/patches/hppa-lock-obj-tweak.patch	(original)
+++ libgpg-error/trunk/debian/patches/hppa-lock-obj-tweak.patch	Wed Aug  6 04:26:41 2014
@@ -1,43 +1,110 @@
-commit 66b69f72ab8706eefbcd49b5a62e6e56d9053f3c
-Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
-Date:   Tue Aug 5 09:30:38 2014 -0400
+commit 3325403c0dd2949bf52efa1b9a5b5cf3191110f9
+Author: Werner Koch <wk at gnupg.org>
+Date:   Tue Aug 5 19:32:51 2014 +0200
 
-    Fix struct alignment on hppa-linux
+    Use 16 byte alignment for hppa-unknown-linux-gnu.
     
-    As reported by John David Anglin <dave.anglin at bell.net>:
+    * configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): New.
+    * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Set for HPPA-Linux.
+    (main): Enforce alignment if needed.
+    * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Use 16 byte
+    alignment.
+    --
     
-    libgpg-error fails to build on hppa because the t-lock test fails.
-    The test fails because the _gpgrt_lock_t and gpgrt_lock_t objects have
-    different sizes.  This happens becuase the pthread_mutex_t type on
-    hppa-linux has 16-byte alignement, but the code in
-    gen-posix-lock-obj.c assumes that a long or pointer to long will
-    provide sufficient alignment.
-    
-    (see https://bugs.debian.org/757060)
+    Debian-bug-id: 757060
 
+diff --git a/configure.ac b/configure.ac
+index 653d7ed..e1f167f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -167,6 +167,20 @@ AC_CHECK_FUNCS([flockfile])
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ 
++#
++# Check whether the compiler supports the GCC style aligned attribute
++#
++AC_CACHE_CHECK([whether the GCC style aligned attribute is supported],
++       [gcry_cv_gcc_attribute_aligned],
++       [gcry_cv_gcc_attribute_aligned=no
++        AC_COMPILE_IFELSE([AC_LANG_SOURCE(
++          [[struct { int a; } foo __attribute__ ((aligned (16)));]])],
++          [gcry_cv_gcc_attribute_aligned=yes])])
++if test "$gcry_cv_gcc_attribute_aligned" = "yes" ; then
++   AC_DEFINE(HAVE_GCC_ATTRIBUTE_ALIGNED,1,
++     [Defined if a GCC style "__attribute__ ((aligned (n))" is supported])
++fi
++
+ 
+ # Check for thread library.
+ #
+@@ -278,5 +292,12 @@ echo "
+ 
+         Revision: mym4_revision  (mym4_revision_dec)
+         Platform: $host
+-
+ "
++if test "$gcry_cv_gcc_attribute_aligned" != "yes" ; then
++cat <<G10EOF
++***
++***  Please not that your compiler does not support the GCC style
++***  aligned attribute.  Using this software may evoke bus errors.
++***
++G10EOF
++fi
 diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
-index df732c3..faba83e 100644
+index df732c3..d2bc645 100644
 --- a/src/gen-posix-lock-obj.c
 +++ b/src/gen-posix-lock-obj.c
-@@ -76,6 +76,9 @@ main (void)
+@@ -40,6 +40,19 @@
+ # error sizeof pthread_mutex_t is not known.
+ #endif
+ 
++/* Special requirements for certain platforms.  */
++#if defined(__hppa__) && defined(__linux__)
++# define USE_16BYTE_ALIGNMENT 1
++#else
++# define USE_16BYTE_ALIGNMENT 0
++#endif
++
++
++#if USE_16BYTE_ALIGNMENT && !HAVE_GCC_ATTRIBUTE_ALIGNED
++# error compiler is not able to enforce a 16 byte alignment
++#endif
++
++
+ static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+ 
+ 
+@@ -76,6 +89,7 @@ main (void)
            "  long _vers;\n"
            "  union {\n"
            "    volatile char _priv[%d];\n"
-+#if defined(__hppa__) && defined(__linux__)
-+          "    int __lock __attribute__ ((aligned(16)));\n"
-+#endif
++          "%s"
            "    long _x_align;\n"
            "    long *_xp_align;\n"
            "  } u;\n"
+@@ -84,6 +98,11 @@ main (void)
+           "#define GPGRT_LOCK_INITIALIZER {%d,{{",
+           HOST_TRIPLET_STRING,
+           SIZEOF_PTHREAD_MUTEX_T,
++#if USE_16BYTE_ALIGNMENT
++          "    int _x16_align __attribute__ ((aligned (16)));\n",
++#else
++          "",
++#endif
+           LOCK_ABI_VERSION);
+   p = (unsigned char *)&mtx;
+   for (i=0; i < sizeof mtx; i++)
 diff --git a/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h
-index fd47664..7758604 100644
+index fd47664..b57bb76 100644
 --- a/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h
 +++ b/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h
 @@ -7,6 +7,7 @@ typedef struct
    long _vers;
    union {
      volatile char _priv[48];
-+    int __lock __attribute__ ((aligned(16)));
++    int _x16_align __attribute__ ((aligned (16)));
      long _x_align;
      long *_xp_align;
    } u;




More information about the Pkg-gnupg-commit mailing list