1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
This file is part of MXE.
See index.html for further information.
These patches have been taken from http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git
http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-mingw64-use-correct-datatype-for-GetProcessWorkingSet.patch
--- a/random/rndw32.c.orig 2011-07-04 19:11:18.137525831 +0200
+++ b/random/rndw32.c 2011-07-04 19:11:40.785404249 +0200
@@ -887,7 +887,7 @@
{
HANDLE handle;
FILETIME creationTime, exitTime, kernelTime, userTime;
- DWORD minimumWorkingSetSize, maximumWorkingSetSize;
+ SIZE_T minimumWorkingSetSize, maximumWorkingSetSize;
handle = GetCurrentThread ();
GetThreadTimes (handle, &creationTime, &exitTime,
http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-correct-def-file.patch
--- a/src/libgcrypt.def.orig 2012-02-28 00:16:33.422552508 +0100
+++ b/src/libgcrypt.def 2012-02-28 00:16:59.188018940 +0100
@@ -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
http://pkgs.fedoraproject.org/cgit/mingw-libgcrypt.git/plain/libgcrypt-use-correct-asm-code-for-win64.patch
--- a/mpi/mpi-internal.h.orig 2013-01-02 12:04:49.634772462 +0100
+++ b/mpi/mpi-internal.h 2013-01-02 12:11:41.222744150 +0100
@@ -168,6 +168,12 @@
} 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 );
@@ -186,7 +192,7 @@
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);
@@ -194,7 +200,7 @@
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);
@@ -216,9 +222,9 @@
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,
@@ -235,7 +241,7 @@
/*-- 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,
@@ -249,9 +255,9 @@
/*-- 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. */
--- a/mpi/generic/mpi-asm-defs.h.orig 2013-01-02 15:07:53.540464492 +0100
+++ b/mpi/generic/mpi-asm-defs.h 2013-01-02 15:08:16.720633878 +0100
@@ -1,8 +1,11 @@
/* This file defines some basic constants for the MPI machinery. We
* need to define the types on a per-CPU basis, so it is done with
* this file here. */
+#ifdef _WIN64
+#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG_LONG)
+#else
#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG)
-
+#endif
|