summaryrefslogtreecommitdiffstats
path: root/src/libgcrypt-1-fixes.patch
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2014-12-04 04:52:54 (GMT)
committerTony Theodore <tonyt@logyst.com>2014-12-04 04:52:54 (GMT)
commit46e1a4c290a6c0925a6d65dc15e653f7aef2c973 (patch)
tree8762451c05cc1a3ea6460e8828abd60425b77ab4 /src/libgcrypt-1-fixes.patch
parent4571504ef86c10e38d4fbe01784f3551de2f8319 (diff)
downloadmxe-46e1a4c290a6c0925a6d65dc15e653f7aef2c973.zip
mxe-46e1a4c290a6c0925a6d65dc15e653f7aef2c973.tar.gz
mxe-46e1a4c290a6c0925a6d65dc15e653f7aef2c973.tar.bz2
libgcrypt: fix x86_64-w64-mingw32 builds
Diffstat (limited to 'src/libgcrypt-1-fixes.patch')
-rw-r--r--src/libgcrypt-1-fixes.patch142
1 files changed, 142 insertions, 0 deletions
diff --git a/src/libgcrypt-1-fixes.patch b/src/libgcrypt-1-fixes.patch
new file mode 100644
index 0000000..aa8e8fc
--- /dev/null
+++ b/src/libgcrypt-1-fixes.patch
@@ -0,0 +1,142 @@
+This file is part of MXE.
+See index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 51d564de8fec65610977732baf46987db3dd2f1c Mon Sep 17 00:00:00 2001
+From: MXE
+Date: Thu, 4 Dec 2014 15:07:43 +1100
+Subject: [PATCH] Taken from:
+
+https://aur.archlinux.org/packages/mingw-w64-libgcrypt/
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 0791b84..b520db1 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -102,7 +102,9 @@ AC_DEFUN([GNUPG_SYS_SYMBOL_UNDERSCORE],
+ [tmp_do_check="no"
+ case "${host}" in
+ *-mingw32*)
+- ac_cv_sys_symbol_underscore=yes
++ if test "x$ac_cv_sys_symbol_underscore" = x ; then
++ ac_cv_sys_symbol_underscore=yes
++ fi
+ ;;
+ i386-emx-os2 | i[3456]86-pc-os2*emx | i386-pc-msdosdjgpp)
+ ac_cv_sys_symbol_underscore=yes
+diff --git a/mpi/generic/mpi-asm-defs.h b/mpi/generic/mpi-asm-defs.h
+index e607806..4c57111 100644
+--- a/mpi/generic/mpi-asm-defs.h
++++ b/mpi/generic/mpi-asm-defs.h
+@@ -4,5 +4,9 @@
+ #if __GNUC__ >= 3 && defined(__x86_64__) && defined(__ILP32__)
+ #define BYTES_PER_MPI_LIMB 8
+ #else
++#ifdef _WIN64
++#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG)
++#else
+ #define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG)
+ #endif
++#endif
+diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
+index 898ca47..afd1a1f 100644
+--- a/mpi/mpi-internal.h
++++ b/mpi/mpi-internal.h
+@@ -169,6 +169,12 @@ typedef int mpi_size_t; /* (must be a signed type) */
+ } while (0)
+
+
++#ifdef _WIN64
++#define ATTR_ABI __attribute__ ((sysv_abi))
++#else
++#define ATTR_ABI
++#endif
++
+ /*-- mpiutil.c --*/
+ #define mpi_alloc_limb_space(n,f) _gcry_mpi_alloc_limb_space((n),(f))
+ mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec );
+@@ -187,7 +193,7 @@ void _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count );
+ mpi_limb_t _gcry_mpih_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+ mpi_size_t s1_size, mpi_limb_t s2_limb );
+ mpi_limb_t _gcry_mpih_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+- mpi_ptr_t s2_ptr, mpi_size_t size);
++ mpi_ptr_t s2_ptr, mpi_size_t size) ATTR_ABI;
+ mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
+ mpi_ptr_t s2_ptr, mpi_size_t s2_size);
+
+@@ -195,7 +201,7 @@ mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_siz
+ mpi_limb_t _gcry_mpih_sub_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+ mpi_size_t s1_size, mpi_limb_t s2_limb );
+ mpi_limb_t _gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+- mpi_ptr_t s2_ptr, mpi_size_t size);
++ mpi_ptr_t s2_ptr, mpi_size_t size) ATTR_ABI;
+ mpi_limb_t _gcry_mpih_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
+ mpi_ptr_t s2_ptr, mpi_size_t s2_size);
+
+@@ -217,9 +223,9 @@ struct karatsuba_ctx {
+ void _gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx );
+
+ mpi_limb_t _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+- mpi_size_t s1_size, mpi_limb_t s2_limb);
++ mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI;
+ mpi_limb_t _gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+- mpi_size_t s1_size, mpi_limb_t s2_limb);
++ mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI;
+ void _gcry_mpih_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
+ mpi_size_t size);
+ mpi_limb_t _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
+@@ -236,7 +242,7 @@ void _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
+
+ /*-- mpih-mul_1.c (or xxx/cpu/ *.S) --*/
+ mpi_limb_t _gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+- mpi_size_t s1_size, mpi_limb_t s2_limb);
++ mpi_size_t s1_size, mpi_limb_t s2_limb) ATTR_ABI;
+
+ /*-- mpih-div.c --*/
+ mpi_limb_t _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
+@@ -250,9 +256,9 @@ mpi_limb_t _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
+
+ /*-- mpih-shift.c --*/
+ mpi_limb_t _gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
+- unsigned cnt);
++ unsigned cnt) ATTR_ABI;
+ mpi_limb_t _gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
+- unsigned cnt);
++ unsigned cnt) ATTR_ABI;
+
+
+ /* Define stuff for longlong.h. */
+diff --git a/random/rndw32.c b/random/rndw32.c
+index c495131..71cca03 100644
+--- a/random/rndw32.c
++++ b/random/rndw32.c
+@@ -888,7 +888,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
+ {
+ HANDLE handle;
+ FILETIME creationTime, exitTime, kernelTime, userTime;
+- DWORD minimumWorkingSetSize, maximumWorkingSetSize;
++ SIZE_T minimumWorkingSetSize, maximumWorkingSetSize;
+
+ handle = GetCurrentThread ();
+ GetThreadTimes (handle, &creationTime, &exitTime,
+diff --git a/src/libgcrypt.def b/src/libgcrypt.def
+index a90efce..b5f476d 100644
+--- a/src/libgcrypt.def
++++ b/src/libgcrypt.def
+@@ -1,3 +1,4 @@
++EXPORTS
+ ;; libgcrypt.defs - Exported symbols for W32
+ ;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+ ;;
+@@ -22,7 +23,6 @@
+ ;; never be changed. Also check libgcrypt.vers and visibility.h.
+
+
+-EXPORTS
+ gcry_check_version @1
+ gcry_control @2
+
+--
+1.9.3 (Apple Git-50)
+