1 |
commit: 5cb91b30730a8a444906aeb2acb981b1ac5a0217 |
2 |
Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 26 08:24:09 2019 +0000 |
4 |
Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 26 08:24:19 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5cb91b30 |
7 |
|
8 |
dev-libs/openssl: use upstream cygwin binmode patches |
9 |
|
10 |
Package-Manager: Portage-2.3.55.1-prefix, Repoman-2.3.12 |
11 |
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org> |
12 |
|
13 |
.../files/openssl-1.1.1a-cygwin-binmode.patch | 79 +++++++++++----------- |
14 |
1 file changed, 40 insertions(+), 39 deletions(-) |
15 |
|
16 |
diff --git a/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch b/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch |
17 |
index 8e9eacef76..f68a5dbfea 100644 |
18 |
--- a/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch |
19 |
+++ b/dev-libs/openssl/files/openssl-1.1.1a-cygwin-binmode.patch |
20 |
@@ -1,30 +1,37 @@ |
21 |
-For the setmode(O_TEXT), not submitted upstream yet: |
22 |
-https://cygwin.com/ml/cygwin/2019-02/msg00150.html |
23 |
-https://cygwin.com/ml/cygwin/2019-02/msg00280.html |
24 |
- |
25 |
-For the chmod, accepted upstream: |
26 |
+https://github.com/openssl/openssl/pull/8249 |
27 |
https://github.com/openssl/openssl/pull/8226 |
28 |
---- openssl-1.1.1a/crypto/bio/bss_file.c.orig 2019-02-15 19:41:48.605378800 +0100 |
29 |
-+++ openssl-1.1.1a/crypto/bio/bss_file.c 2019-02-15 19:42:53.136709200 +0100 |
30 |
-@@ -253,9 +253,14 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) |
31 |
+ |
32 |
+From ba96d34ec2f8cf7823ad9ee5295f2e9b5653f2d2 Mon Sep 17 00:00:00 2001 |
33 |
+From: Corinna Vinschen <vinschen@××××××.com> |
34 |
+Date: Fri, 15 Feb 2019 12:24:47 +0100 |
35 |
+Subject: [PATCH] cygwin: drop explicit O_TEXT |
36 |
+ |
37 |
+Cygwin binaries should not enforce text mode these days, just |
38 |
+use text mode if the underlying mount point requests it |
39 |
+ |
40 |
+CLA: trivial |
41 |
+ |
42 |
+Signed-off-by: Corinna Vinschen <vinschen@××××××.com> |
43 |
+--- |
44 |
+ crypto/bio/bss_file.c | 9 +++++---- |
45 |
+ 1 file changed, 5 insertions(+), 4 deletions(-) |
46 |
+ |
47 |
+diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c |
48 |
+index a2b8700f22f..93ba00691bc 100644 |
49 |
+--- a/crypto/bio/bss_file.c |
50 |
++++ b/crypto/bio/bss_file.c |
51 |
+@@ -253,9 +253,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) |
52 |
} |
53 |
# elif defined(OPENSSL_SYS_WIN32_CYGWIN) |
54 |
int fd = fileno((FILE *)ptr); |
55 |
- if (num & BIO_FP_TEXT) |
56 |
- setmode(fd, O_TEXT); |
57 |
- else |
58 |
-+ if (num & BIO_FP_TEXT) { |
59 |
-+ /* Cygwin prefers text mode with text mounts only, |
60 |
-+ * so we can force text mode if we do reads only. */ |
61 |
-+ if (fcntl(fd, F_GETFL) & O_RDONLY) |
62 |
-+ setmode(fd, O_TEXT); /* Ignore \r with any read. */ |
63 |
-+ else |
64 |
-+ setmode(fd, 0); /* allow but do not force text mode */ |
65 |
-+ } else |
66 |
++ if (!(num & BIO_FP_TEXT)) |
67 |
setmode(fd, O_BINARY); |
68 |
# endif |
69 |
} |
70 |
-@@ -279,11 +284,21 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) |
71 |
+@@ -279,11 +277,14 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) |
72 |
ret = 0; |
73 |
break; |
74 |
} |
75 |
@@ -37,31 +44,25 @@ https://github.com/openssl/openssl/pull/8226 |
76 |
+# elif defined(OPENSSL_SYS_WIN32_CYGWIN) |
77 |
+ if (!(num & BIO_FP_TEXT)) |
78 |
+ OPENSSL_strlcat(p, "b", sizeof(p)); |
79 |
-+ else if (!(num & BIO_FP_APPEND) && !(num & BIO_FP_WRITE)) { |
80 |
-+ /* Cygwin prefers text mode with text mounts only, |
81 |
-+ * so we can force text mode if we do reads only. |
82 |
-+ * Unfortunately, the only API to disable binmode |
83 |
-+ * without forcing textmode is setmode(fd, 0). */ |
84 |
-+ OPENSSL_strlcat(p, "t", sizeof(p)); |
85 |
-+ } |
86 |
# endif |
87 |
fp = openssl_fopen(ptr, p); |
88 |
if (fp == NULL) { |
89 |
-@@ -293,6 +308,11 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) |
90 |
- ret = 0; |
91 |
- break; |
92 |
- } |
93 |
-+# if defined(OPENSSL_SYS_WIN32_CYGWIN) |
94 |
-+ if ((num & BIO_FP_TEXT) |
95 |
-+ && ((num & BIO_FP_APPEND) || (num & BIO_FP_WRITE))) |
96 |
-+ setmode(fileno(fp), 0); /* allow but do not force text mode */ |
97 |
-+# endif |
98 |
- b->ptr = fp; |
99 |
- b->init = 1; |
100 |
- BIO_clear_flags(b, BIO_FLAGS_UPLINK); /* we did fopen -> we disengage |
101 |
---- openssl-1.1.1a/Configurations/unix-Makefile.tmpl.orig 2019-02-15 19:47:36.464755100 +0100 |
102 |
-+++ openssl-1.1.1a/Configurations/unix-Makefile.tmpl 2019-02-15 19:47:42.605379700 +0100 |
103 |
-@@ -650,7 +650,7 @@ |
104 |
+ |
105 |
+From fc9aa8bb86a5765f44d3167816aece4b9d954e4a Mon Sep 17 00:00:00 2001 |
106 |
+From: Michael Haubenwallner <michael.haubenwallner@××××××××××××.com> |
107 |
+Date: Wed, 13 Feb 2019 16:52:04 +0100 |
108 |
+Subject: [PATCH] Windows/Cygwin dlls need the executable bit set |
109 |
+ |
110 |
+CLA: trivial |
111 |
+--- |
112 |
+ Configurations/unix-Makefile.tmpl | 2 +- |
113 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
114 |
+ |
115 |
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl |
116 |
+index 7705b03b8e2..0b744bb7af4 100644 |
117 |
+--- a/Configurations/unix-Makefile.tmpl |
118 |
++++ b/Configurations/unix-Makefile.tmpl |
119 |
+@@ -622,7 +622,7 @@ install_runtime_libs: build_libs |
120 |
: {- output_off() unless windowsdll(); "" -}; \ |
121 |
$(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \ |
122 |
cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \ |