summaryrefslogtreecommitdiff
path: root/security/libgcrypt
diff options
context:
space:
mode:
authorrichard <richard@pkgsrc.org>2014-01-07 17:18:29 +0000
committerrichard <richard@pkgsrc.org>2014-01-07 17:18:29 +0000
commit1f1679c54f21173e268a24efa837eaba1c3f9d6d (patch)
treee138428ff3bfdf06df0f1a73c4d7d075cab8f04e /security/libgcrypt
parent02f4c2613e58563fb35982952d52ca2ef33822ff (diff)
downloadpkgsrc-1f1679c54f21173e268a24efa837eaba1c3f9d6d.tar.gz
revise recent -Wa,--divide usage for SunOS to allow only SunOS x86_64
and naturally non-gcc/non-gas builds by patching configure instead (adapted from configure.ac in the works upstream).
Diffstat (limited to 'security/libgcrypt')
-rw-r--r--security/libgcrypt/Makefile4
-rw-r--r--security/libgcrypt/distinfo3
-rw-r--r--security/libgcrypt/patches/patch-configure89
3 files changed, 92 insertions, 4 deletions
diff --git a/security/libgcrypt/Makefile b/security/libgcrypt/Makefile
index 37a68c62314..c5ae40bc292 100644
--- a/security/libgcrypt/Makefile
+++ b/security/libgcrypt/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2014/01/02 15:56:11 richard Exp $
+# $NetBSD: Makefile,v 1.60 2014/01/07 17:18:29 richard Exp $
DISTNAME= libgcrypt-1.6.0
CATEGORIES= security
@@ -23,8 +23,6 @@ INFO_FILES= yes # PLIST
.include "../../mk/bsd.prefs.mk"
-CPPFLAGS.SunOS+= -Wa,--divide
-
.if empty(MACHINE_PLATFORM:MNetBSD-*-i386) && \
empty(MACHINE_PLATFORM:MNetBSD-*-alpha) && \
empty(MACHINE_PLATFORM:MNetBSD-*-sparc) && \
diff --git a/security/libgcrypt/distinfo b/security/libgcrypt/distinfo
index e3a722ac561..dc47756917e 100644
--- a/security/libgcrypt/distinfo
+++ b/security/libgcrypt/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.40 2014/01/01 11:49:59 wiz Exp $
+$NetBSD: distinfo,v 1.41 2014/01/07 17:18:29 richard Exp $
SHA1 (libgcrypt-1.6.0.tar.bz2) = 43283c0b41c41e3d3bc13c2d8f937dfe2aaa1a77
RMD160 (libgcrypt-1.6.0.tar.bz2) = 33e4e45116a64999c4cd0d132a4a968612057f40
@@ -6,3 +6,4 @@ Size (libgcrypt-1.6.0.tar.bz2) = 2499149 bytes
SHA1 (patch-aa) = 7c46612f912d45dfd4ce4f4b510e72c00bd38585
SHA1 (patch-ab) = 6fac21daa26b7de3b13839d076f78a74400efce7
SHA1 (patch-ad) = 19345b7d164521d526a44eb3f1a465ff09d8266c
+SHA1 (patch-configure) = c4e10bdb7e00a44d507f5b964f3e71a63828cd0a
diff --git a/security/libgcrypt/patches/patch-configure b/security/libgcrypt/patches/patch-configure
new file mode 100644
index 00000000000..06a7d18aa19
--- /dev/null
+++ b/security/libgcrypt/patches/patch-configure
@@ -0,0 +1,89 @@
+$NetBSD: patch-configure,v 1.1 2014/01/07 17:18:29 richard Exp $
+cipher/sha1-ssse3-amd64.S suffers a supposedly "infamous" problem wherein
+expressions containing a '/' (divide) are problematic because according to
+the SUN x86 Assembly Language Reference Manual, '/' should be treated as
+starting comments.
+
+To get over this, gas has '--divide' do not treat `/' as a comment character
+
+Upstream will check this out during 'configure'.
+
+--- configure.orig 2014-01-07 13:33:50.440430723 +0000
++++ configure
+@@ -16932,13 +16932,63 @@ $as_echo "#define HAVE_GCC_INLINE_ASM_BM
+
+ fi
+
++#
++# Check whether GCC assembler needs "-Wa,--divide" to correctly handle
++# constant division
++#
++if test $amd64_as_feature_detection = yes; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC assembler handles division correctly" >&5
++$as_echo_n "checking whether GCC assembler handles division correctly... " >&6; }
++if ${gcry_cv_gcc_as_const_division_ok+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ gcry_cv_gcc_as_const_division_ok=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++__asm__("xorl \$(123456789/12345678), %ebp;\n\t");
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ gcry_cv_gcc_as_const_division_ok=yes
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcry_cv_gcc_as_const_division_ok" >&5
++$as_echo "$gcry_cv_gcc_as_const_division_ok" >&6; }
++ if test "$gcry_cv_gcc_as_const_division_ok" = "no" ; then
++ #
++ # Add '-Wa,--divide' to CPPFLAGS and try check again.
++ #
++ _gcc_cppflags_save="$CPPFLAGS"
++ CPPFLAGS="$CPPFLAGS -Wa,--divide"
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC assembler handles division correctly with \"-Wa,--divide\"" >&5
++$as_echo_n "checking whether GCC assembler handles division correctly with \"-Wa,--divide\"... " >&6; }
++if ${gcry_cv_gcc_as_const_division_with_wadivide_ok+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ gcry_cv_gcc_as_const_division_with_wadivide_ok=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++__asm__("xorl \$(123456789/12345678), %ebp;\n\t");
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ gcry_cv_gcc_as_const_division_with_wadivide_ok=yes
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcry_cv_gcc_as_const_division_with_wadivide_ok" >&5
++$as_echo "$gcry_cv_gcc_as_const_division_with_wadivide_ok" >&6; }
++ if test "$gcry_cv_gcc_as_const_division_with_wadivide_ok" = "no" ; then
++ CPPFLAGS="$_gcc_cppflags_save"
++ fi
++ fi
++fi
+
+ #
+ # Check whether GCC assembler supports features needed for our amd64
+ # implementations
+ #
+ if test $amd64_as_feature_detection = yes; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC assembler is compatible for amd64 assembly implementations" >&5
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC assembler is compatible for amd64 assembly implementations" >&5
+ $as_echo_n "checking whether GCC assembler is compatible for amd64 assembly implementations... " >&6; }
+ if ${gcry_cv_gcc_amd64_platform_as_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+@@ -16955,6 +17005,11 @@ __asm__(
+ "asmfunc:\n\t"
+ ".size asmfunc,.-asmfunc;\n\t"
+ ".type asmfunc,@function;\n\t"
++ /* Test if assembler allows use of '/' for constant division
++ * (Solaris/x86 issue). If previous constant division check
++ * and "-Wa,--divide" workaround failed, this causes assembly
++ * to be disable on this machine. */
++ "xorl \$(123456789/12345678), %ebp;\n\t"
+ );
+ _ACEOF
+ if ac_fn_c_try_compile "$LINENO"; then :