summaryrefslogtreecommitdiffhomepage
path: root/libressl-2.2.6.local.patch
blob: b6cf20fb834aa071f4ec4d8ec28d374d311f1277 (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
--- libressl-2.2.6/config.sub.orig	2016-01-28 19:18:06.000000000 +0100
+++ libressl-2.2.6/config.sub	2016-02-12 17:19:40.807245600 +0100
@@ -804,6 +804,9 @@
 	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	midipix)
+		os=-midipix;
+		;;
 	mingw64)
 		basic_machine=x86_64-pc
 		os=-mingw64
@@ -1384,7 +1387,7 @@
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
--- libressl-2.2.6/crypto/compat/arc4random.h.orig	2015-10-15 23:18:44.000000000 +0200
+++ libressl-2.2.6/crypto/compat/arc4random.h	2016-02-12 17:19:40.815245600 +0100
@@ -12,7 +12,7 @@
 #elif defined(__hpux)
 #include "arc4random_hpux.h"
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__MIDIPIX)
 #include "arc4random_linux.h"
 
 #elif defined(__NetBSD__)
--- libressl-2.2.6/crypto/compat/getentropy_linux.c.orig	2015-10-16 00:04:58.000000000 +0200
+++ libressl-2.2.6/crypto/compat/getentropy_linux.c	2016-02-12 17:48:47.474391200 +0100
@@ -27,7 +27,7 @@
 #include <sys/ioctl.h>
 #include <sys/resource.h>
 #include <sys/syscall.h>
-#ifdef SYS__sysctl
+#if defined(SYS__sysctl) && !defined(__MIDIPIX)
 #include <linux/sysctl.h>
 #endif
 #include <sys/statvfs.h>
@@ -49,8 +49,10 @@
 #include <time.h>
 #include <openssl/sha.h>
 
+#ifndef __MIDIPIX
 #include <linux/types.h>
 #include <linux/random.h>
+#endif
 #ifdef HAVE_GETAUXVAL
 #include <sys/auxv.h>
 #endif
@@ -78,7 +80,7 @@
 static int getentropy_getrandom(void *buf, size_t len);
 #endif
 static int getentropy_urandom(void *buf, size_t len);
-#ifdef SYS__sysctl
+#if defined(SYS__sysctl) && !defined(__MIDIPIX)
 static int getentropy_sysctl(void *buf, size_t len);
 #endif
 static int getentropy_fallback(void *buf, size_t len);
@@ -115,7 +117,7 @@
 	if (ret != -1)
 		return (ret);
 
-#ifdef SYS__sysctl
+#if defined(SYS__sysctl) && !defined(__MIDIPIX)
 	/*
 	 * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
 	 * sysctl is a failsafe API, so it guarantees a result.  This
@@ -241,10 +243,12 @@
 		close(fd);
 		goto nodevrandom;
 	}
+#ifndef __MIDIPIX
 	if (ioctl(fd, RNDGETENTCNT, &cnt) == -1) {
 		close(fd);
 		goto nodevrandom;
 	}
+#endif
 	for (i = 0; i < len; ) {
 		size_t wanted = len - i;
 		ssize_t ret = read(fd, (char *)buf + i, wanted);
@@ -267,7 +271,7 @@
 	return -1;
 }
 
-#ifdef SYS__sysctl
+#if defined(SYS__sysctl) && !defined(__MIDIPIX)
 static int
 getentropy_sysctl(void *buf, size_t len)
 {
--- libressl-2.2.6/crypto/Makefile.in.orig	2016-01-28 19:18:08.000000000 +0100
+++ libressl-2.2.6/crypto/Makefile.in	2016-02-12 17:19:40.823245600 +0100
@@ -111,10 +111,11 @@
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__append_19 = compat/getentropy_freebsd.c
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__append_20 = compat/getentropy_hpux.c
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__append_21 = compat/getentropy_linux.c
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__append_22 = compat/getentropy_netbsd.c
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__append_23 = compat/getentropy_osx.c
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__append_24 = compat/getentropy_solaris.c
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__append_25 = compat/getentropy_win.c
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_MIDIPIX_TRUE@am__append_22 = compat/getentropy_linux.c
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__append_23 = compat/getentropy_netbsd.c
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__append_24 = compat/getentropy_osx.c
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__append_25 = compat/getentropy_solaris.c
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__append_26 = compat/getentropy_win.c
 @HOST_ASM_ELF_X86_64_TRUE@am__append_26 = -DAES_ASM -DBSAES_ASM \
 @HOST_ASM_ELF_X86_64_TRUE@	-DVPAES_ASM -DOPENSSL_IA32_SSE2 \
 @HOST_ASM_ELF_X86_64_TRUE@	-DOPENSSL_BN_ASM_MONT \
@@ -220,17 +221,18 @@
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_FREEBSD_TRUE@am__objects_13 = compat/getentropy_freebsd.lo
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_HPUX_TRUE@am__objects_14 = compat/getentropy_hpux.lo
 @HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_LINUX_TRUE@am__objects_15 = compat/getentropy_linux.lo
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__objects_16 = compat/getentropy_netbsd.lo
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__objects_17 = compat/getentropy_osx.lo
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__objects_18 = compat/getentropy_solaris.lo
-@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__objects_19 = compat/getentropy_win.lo
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_MIDIPIX_TRUE@am__objects_16 = compat/getentropy_linux.lo
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_NETBSD_TRUE@am__objects_17 = compat/getentropy_netbsd.lo
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_DARWIN_TRUE@am__objects_18 = compat/getentropy_osx.lo
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_SOLARIS_TRUE@am__objects_19 = compat/getentropy_solaris.lo
+@HAVE_ARC4RANDOM_BUF_FALSE@@HAVE_GETENTROPY_FALSE@@HOST_WIN_TRUE@am__objects_20 = compat/getentropy_win.lo
 am_libcompat_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
 	$(am__objects_3) $(am__objects_4) $(am__objects_5) \
 	$(am__objects_6) $(am__objects_7) $(am__objects_8) \
 	$(am__objects_9) $(am__objects_10) $(am__objects_11) \
 	$(am__objects_12) $(am__objects_13) $(am__objects_14) \
 	$(am__objects_15) $(am__objects_16) $(am__objects_17) \
-	$(am__objects_18) $(am__objects_19)
+	$(am__objects_18) $(am__objects_19) $(am__objects_20)
 libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -985,7 +987,7 @@
 	$(am__append_16) $(am__append_17) $(am__append_18) \
 	$(am__append_19) $(am__append_20) $(am__append_21) \
 	$(am__append_22) $(am__append_23) $(am__append_24) \
-	$(am__append_25)
+	$(am__append_25) $(am__append_26)
 libcompat_la_LIBADD = $(PLATFORM_LDADD)
 
 # rc4
--- libressl-2.2.6/include/compat/machine/endian.h.orig	2015-10-15 23:18:44.000000000 +0200
+++ libressl-2.2.6/include/compat/machine/endian.h	2016-02-12 17:19:40.827245600 +0100
@@ -21,7 +21,7 @@
 #define BYTE_ORDER BIG_ENDIAN
 #endif
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__MIDIPIX)
 #include <endian.h>
 
 #elif defined(__sun) || defined(_AIX) || defined(__hpux)
--- libressl-2.2.6/configure.orig	2016-01-28 18:18:06.000000000 +0000
+++ libressl-2.2.6/configure	2016-02-23 13:25:30.689963257 +0000
@@ -690,6 +690,8 @@
 HOST_NETBSD_TRUE
 HOST_LINUX_FALSE
 HOST_LINUX_TRUE
+HOST_MIDIPIX_FALSE
+HOST_MIDIPIX_TRUE
 HOST_HPUX_FALSE
 HOST_HPUX_TRUE
 HOST_FREEBSD_FALSE
@@ -10824,7 +10826,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | midipix*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -11902,6 +11904,11 @@
 		HOST_ABI=elf
 		CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
 		;;
+	*midipix*)
+		HOST_OS=midipix
+		HOST_ABI=pe
+		CFLAGS="$CFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
+		;;
 	*netbsd*)
 		HOST_OS=netbsd
 		CPPFLAGS="$CPPFLAGS -D_OPENBSD_SOURCE"
@@ -11981,6 +11988,14 @@
   HOST_LINUX_FALSE=
 fi
 
+ if test x$HOST_OS = xmidipix; then
+  HOST_MIDIPIX_TRUE=
+  HOST_MIDIPIX_FALSE='#'
+else
+  HOST_MIDIPIX_TRUE='#'
+  HOST_MIDIPIX_FALSE=
+fi
+
  if test x$HOST_OS = xnetbsd; then
   HOST_NETBSD_TRUE=
   HOST_NETBSD_FALSE='#'
@@ -13422,6 +13437,10 @@
   as_fn_error $? "conditional \"HOST_LINUX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HOST_MIDIPIX_TRUE}" && test -z "${HOST_MIDIPIX_FALSE}"; then
+  as_fn_error $? "conditional \"HOST_MIDIPIX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HOST_NETBSD_TRUE}" && test -z "${HOST_NETBSD_FALSE}"; then
   as_fn_error $? "conditional \"HOST_NETBSD\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15584,3 +15603,15 @@
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+# a transitional workaround...
+case $host_os in
+		midipix*)
+			cp $ac_confdir/libtool.midipix libtool || exit 2
+
+			sed -i	-e 's/@cbb_host_os@/'$host'/g' \
+				-e 's/@cbb_build_alias@/'$build_alias'/g' \
+				-e 's/@cbb_build_os@/'$build_os'/g' \
+				-e 's/@cbb_build@/'$build'/g' libtool || exit 2
+			;;
+esac
+