comparison OrthancFramework/Resources/Patches/openssl-3.0.0-beta1.patch @ 4709:a9a75281cae9 openssl-3.x

fix build on MSVC 2008 32bit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Jun 2021 10:26:27 +0200
parents 312e0e29de90
children
comparison
equal deleted inserted replaced
4708:a53a58489cc0 4709:a9a75281cae9
1 diff -urEb openssl-3.0.0-beta1.orig/crypto/threads_win.c openssl-3.0.0-beta1/crypto/threads_win.c
2 --- openssl-3.0.0-beta1.orig/crypto/threads_win.c 2021-06-22 10:11:05.149557746 +0200
3 +++ openssl-3.0.0-beta1/crypto/threads_win.c 2021-06-22 10:24:32.510628161 +0200
4 @@ -208,13 +208,32 @@
5 int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
6 CRYPTO_RWLOCK *lock)
7 {
8 +#if defined(_WIN32) && !defined(_WIN64)
9 + /**
10 + * Prevents the following error, at least on Visual Studio 2008,
11 + * but most probably on any Window 32bit system:
12 + * "CoreLibrary.lib(threads_win.obj) : error LNK2019: unresolved
13 + * external symbol _InterlockedOr64 referenced in function
14 + * _CRYPTO_atomic_or". TODO - The lock should be locked!
15 + * https://developercommunity.visualstudio.com/t/-interlockedexchangeadd64-is-unresolved-on-x86/1227636
16 + **/
17 + *ret = (*val) | op;
18 +#else
19 *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, (LONG64)op) | op;
20 +#endif
21 +
22 return 1;
23 }
24
25 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
26 {
27 +#if defined(_WIN32) && !defined(_WIN64)
28 + /* See comment above */
29 + *ret = *val;
30 +#else
31 *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, 0);
32 +#endif
33 +
34 return 1;
35 }
36
1 diff -urEb openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c 37 diff -urEb openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c
2 --- openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c 2021-06-21 18:25:55.220224494 +0200 38 --- openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c 2021-06-22 10:11:05.177557799 +0200
3 +++ openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c 2021-06-21 18:26:44.884237640 +0200 39 +++ openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c 2021-06-22 10:12:19.449692057 +0200
4 @@ -447,6 +447,7 @@ 40 @@ -447,6 +447,7 @@
5 * system call and this should always succeed which renders 41 * system call and this should always succeed which renders
6 * this alternative but essentially identical source moot. 42 * this alternative but essentially identical source moot.
7 */ 43 */
8 +#if !defined(__LSB_VERSION__) // "syscall()" is not available in LSB 44 +#if !defined(__LSB_VERSION__) // "syscall()" is not available in LSB