0008-contrib-gcrypt-update-patches.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. From 3471ea78bcb6ddf51cb110e4b2b721052e79dc18 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
  3. Date: Mon, 12 Sep 2016 17:03:37 +0200
  4. Subject: [PATCH 08/24] contrib/gcrypt: update patches
  5. ---
  6. .../src/gcrypt/fix-sha1-ssse3-for-clang.patch | 308 +++++++++++++++++-
  7. .../work-around-libtool-limitation.patch | 16 +-
  8. 2 files changed, 310 insertions(+), 14 deletions(-)
  9. diff --git a/contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch b/contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch
  10. index f1d3ccc71f..21d7a30c8d 100644
  11. --- a/contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch
  12. +++ b/contrib/src/gcrypt/fix-sha1-ssse3-for-clang.patch
  13. @@ -1,16 +1,312 @@
  14. +diff -ru libgcrypt/cipher/arcfour-amd64.S libgcrypt/cipher/arcfour-amd64.S
  15. +--- libgcrypt/cipher/arcfour-amd64.S 2016-03-23 12:59:34.000000000 +0100
  16. ++++ libgcrypt/cipher/arcfour-amd64.S 2016-09-13 10:41:44.000000000 +0200
  17. +@@ -19,16 +19,20 @@
  18. + defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS))
  19. +
  20. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  21. ++#ifdef __APPLE__
  22. ++# define ELF(...) /*_*/
  23. ++#else
  24. + # define ELF(...) __VA_ARGS__
  25. ++#endif
  26. + #else
  27. + # define ELF(...) /*_*/
  28. + #endif
  29. +
  30. + .text
  31. + .align 16
  32. +-.globl _gcry_arcfour_amd64
  33. ++.globl __gcry_arcfour_amd64
  34. + ELF(.type _gcry_arcfour_amd64,@function)
  35. +-_gcry_arcfour_amd64:
  36. ++__gcry_arcfour_amd64:
  37. + push %rbp
  38. + push %rbx
  39. + mov %rdi, %rbp # key = ARG(key)
  40. +diff -ru libgcrypt/cipher/des-amd64.S libgcrypt/cipher/des-amd64.S
  41. +--- libgcrypt/cipher/des-amd64.S 2016-03-23 12:59:34.000000000 +0100
  42. ++++ libgcrypt/cipher/des-amd64.S 2016-09-13 10:44:32.000000000 +0200
  43. +@@ -30,7 +30,11 @@
  44. + #endif
  45. +
  46. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  47. ++#ifdef __APPLE__
  48. ++# define ELF(...) /*_*/
  49. ++#else
  50. + # define ELF(...) __VA_ARGS__
  51. ++#endif
  52. + #else
  53. + # define ELF(...) /*_*/
  54. + #endif
  55. +@@ -191,10 +195,10 @@
  56. + movl right##d, 4(io);
  57. +
  58. + .align 8
  59. +-.globl _gcry_3des_amd64_crypt_block
  60. ++.globl __gcry_3des_amd64_crypt_block
  61. + ELF(.type _gcry_3des_amd64_crypt_block,@function;)
  62. +
  63. +-_gcry_3des_amd64_crypt_block:
  64. ++__gcry_3des_amd64_crypt_block:
  65. + /* input:
  66. + * %rdi: round keys, CTX
  67. + * %rsi: dst
  68. +@@ -466,7 +470,7 @@
  69. +
  70. + .align 8
  71. + ELF(.type _gcry_3des_amd64_crypt_blk3,@function;)
  72. +-_gcry_3des_amd64_crypt_blk3:
  73. ++__gcry_3des_amd64_crypt_blk3:
  74. + /* input:
  75. + * %rdi: round keys, CTX
  76. + * RL0d, RR0d, RL1d, RR1d, RL2d, RR2d: 3 input blocks
  77. +@@ -538,9 +542,9 @@
  78. + ELF(.size _gcry_3des_amd64_crypt_blk3,.-_gcry_3des_amd64_crypt_blk3;)
  79. +
  80. + .align 8
  81. +-.globl _gcry_3des_amd64_cbc_dec
  82. ++.globl __gcry_3des_amd64_cbc_dec
  83. + ELF(.type _gcry_3des_amd64_cbc_dec,@function;)
  84. +-_gcry_3des_amd64_cbc_dec:
  85. ++__gcry_3des_amd64_cbc_dec:
  86. + /* input:
  87. + * %rdi: ctx, CTX
  88. + * %rsi: dst (3 blocks)
  89. +@@ -574,7 +578,7 @@
  90. + bswapl RL2d;
  91. + bswapl RR2d;
  92. +
  93. +- call _gcry_3des_amd64_crypt_blk3;
  94. ++ call __gcry_3des_amd64_crypt_blk3;
  95. +
  96. + popq %rcx; /*iv*/
  97. + popq %rdx; /*src*/
  98. +@@ -614,9 +618,9 @@
  99. + ELF(.size _gcry_3des_amd64_cbc_dec,.-_gcry_3des_amd64_cbc_dec;)
  100. +
  101. + .align 8
  102. +-.globl _gcry_3des_amd64_ctr_enc
  103. ++.globl __gcry_3des_amd64_ctr_enc
  104. + ELF(.type _gcry_3des_amd64_ctr_enc,@function;)
  105. +-_gcry_3des_amd64_ctr_enc:
  106. ++__gcry_3des_amd64_ctr_enc:
  107. + /* input:
  108. + * %rdi: ctx, CTX
  109. + * %rsi: dst (3 blocks)
  110. +@@ -655,7 +659,7 @@
  111. + /* store new IV */
  112. + movq RT0, (RW2);
  113. +
  114. +- call _gcry_3des_amd64_crypt_blk3;
  115. ++ call __gcry_3des_amd64_crypt_blk3;
  116. +
  117. + popq %rdx; /*src*/
  118. + popq %rsi; /*dst*/
  119. +@@ -692,9 +696,9 @@
  120. + ELF(.size _gcry_3des_amd64_cbc_dec,.-_gcry_3des_amd64_cbc_dec;)
  121. +
  122. + .align 8
  123. +-.globl _gcry_3des_amd64_cfb_dec
  124. ++.globl __gcry_3des_amd64_cfb_dec
  125. + ELF(.type _gcry_3des_amd64_cfb_dec,@function;)
  126. +-_gcry_3des_amd64_cfb_dec:
  127. ++__gcry_3des_amd64_cfb_dec:
  128. + /* input:
  129. + * %rdi: ctx, CTX
  130. + * %rsi: dst (3 blocks)
  131. +@@ -731,7 +735,7 @@
  132. + movq 4 * 4(%rdx), RW0;
  133. + movq RW0, (RW2);
  134. +
  135. +- call _gcry_3des_amd64_crypt_blk3;
  136. ++ call __gcry_3des_amd64_crypt_blk3;
  137. +
  138. + popq %rdx; /*src*/
  139. + popq %rsi; /*dst*/
  140. +diff -ru libgcrypt/cipher/poly1305-avx2-amd64.S libgcrypt/cipher/poly1305-avx2-amd64.S
  141. +--- libgcrypt/cipher/poly1305-avx2-amd64.S 2016-03-23 12:59:34.000000000 +0100
  142. ++++ libgcrypt/cipher/poly1305-avx2-amd64.S 2016-09-13 10:43:05.000000000 +0200
  143. +@@ -30,7 +30,11 @@
  144. + defined(ENABLE_AVX2_SUPPORT)
  145. +
  146. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  147. ++#ifdef __APPLE__
  148. ++# define ELF(...) /*_*/
  149. ++#else
  150. + # define ELF(...) __VA_ARGS__
  151. ++#endif
  152. + #else
  153. + # define ELF(...) /*_*/
  154. + #endif
  155. +@@ -40,9 +44,9 @@
  156. +
  157. +
  158. + .align 8
  159. +-.globl _gcry_poly1305_amd64_avx2_init_ext
  160. ++.globl __gcry_poly1305_amd64_avx2_init_ext
  161. + ELF(.type _gcry_poly1305_amd64_avx2_init_ext,@function;)
  162. +-_gcry_poly1305_amd64_avx2_init_ext:
  163. ++__gcry_poly1305_amd64_avx2_init_ext:
  164. + .Lpoly1305_init_ext_avx2_local:
  165. + xor %edx, %edx
  166. + vzeroupper
  167. +@@ -403,9 +407,9 @@
  168. +
  169. +
  170. + .align 8
  171. +-.globl _gcry_poly1305_amd64_avx2_blocks
  172. ++.globl __gcry_poly1305_amd64_avx2_blocks
  173. + ELF(.type _gcry_poly1305_amd64_avx2_blocks,@function;)
  174. +-_gcry_poly1305_amd64_avx2_blocks:
  175. ++__gcry_poly1305_amd64_avx2_blocks:
  176. + .Lpoly1305_blocks_avx2_local:
  177. + vzeroupper
  178. + pushq %rbp
  179. +@@ -729,9 +733,9 @@
  180. +
  181. +
  182. + .align 8
  183. +-.globl _gcry_poly1305_amd64_avx2_finish_ext
  184. ++.globl __gcry_poly1305_amd64_avx2_finish_ext
  185. + ELF(.type _gcry_poly1305_amd64_avx2_finish_ext,@function;)
  186. +-_gcry_poly1305_amd64_avx2_finish_ext:
  187. ++__gcry_poly1305_amd64_avx2_finish_ext:
  188. + .Lpoly1305_finish_ext_avx2_local:
  189. + vzeroupper
  190. + pushq %rbp
  191. +diff -ru libgcrypt/cipher/poly1305-sse2-amd64.S libgcrypt/cipher/poly1305-sse2-amd64.S
  192. +--- libgcrypt/cipher/poly1305-sse2-amd64.S 2016-03-23 12:59:34.000000000 +0100
  193. ++++ libgcrypt/cipher/poly1305-sse2-amd64.S 2016-09-13 10:42:49.000000000 +0200
  194. +@@ -29,7 +29,11 @@
  195. + defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS))
  196. +
  197. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  198. ++#ifdef __APPLE__
  199. ++# define ELF(...) /*_*/
  200. ++#else
  201. + # define ELF(...) __VA_ARGS__
  202. ++#endif
  203. + #else
  204. + # define ELF(...) /*_*/
  205. + #endif
  206. +@@ -39,9 +43,9 @@
  207. +
  208. +
  209. + .align 8
  210. +-.globl _gcry_poly1305_amd64_sse2_init_ext
  211. ++.globl __gcry_poly1305_amd64_sse2_init_ext
  212. + ELF(.type _gcry_poly1305_amd64_sse2_init_ext,@function;)
  213. +-_gcry_poly1305_amd64_sse2_init_ext:
  214. ++__gcry_poly1305_amd64_sse2_init_ext:
  215. + .Lpoly1305_init_ext_x86_local:
  216. + xor %edx, %edx
  217. + pushq %r12
  218. +@@ -285,9 +289,9 @@
  219. +
  220. +
  221. + .align 8
  222. +-.globl _gcry_poly1305_amd64_sse2_finish_ext
  223. ++.globl __gcry_poly1305_amd64_sse2_finish_ext
  224. + ELF(.type _gcry_poly1305_amd64_sse2_finish_ext,@function;)
  225. +-_gcry_poly1305_amd64_sse2_finish_ext:
  226. ++__gcry_poly1305_amd64_sse2_finish_ext:
  227. + .Lpoly1305_finish_ext_x86_local:
  228. + pushq %rbp
  229. + movq %rsp, %rbp
  230. +@@ -436,9 +440,9 @@
  231. +
  232. +
  233. + .align 8
  234. +-.globl _gcry_poly1305_amd64_sse2_blocks
  235. ++.globl __gcry_poly1305_amd64_sse2_blocks
  236. + ELF(.type _gcry_poly1305_amd64_sse2_blocks,@function;)
  237. +-_gcry_poly1305_amd64_sse2_blocks:
  238. ++__gcry_poly1305_amd64_sse2_blocks:
  239. + .Lpoly1305_blocks_x86_local:
  240. + pushq %rbp
  241. + movq %rsp, %rbp
  242. +diff -ru libgcrypt/cipher/sha1-avx-amd64.S libgcrypt/cipher/sha1-avx-amd64.S
  243. +--- libgcrypt/cipher/sha1-avx-amd64.S 2016-07-14 11:19:17.000000000 +0200
  244. ++++ libgcrypt/cipher/sha1-avx-amd64.S 2016-09-13 10:41:55.000000000 +0200
  245. +@@ -41,7 +41,11 @@
  246. +
  247. +
  248. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  249. ++#ifdef __APPLE__
  250. ++# define ELF(...) /*_*/
  251. ++#else
  252. + # define ELF(...) __VA_ARGS__
  253. ++#endif
  254. + #else
  255. + # define ELF(...) /*_*/
  256. + #endif
  257. +@@ -215,10 +219,10 @@
  258. + * size_t nblks)
  259. + */
  260. + .text
  261. +-.globl _gcry_sha1_transform_amd64_avx
  262. ++.globl __gcry_sha1_transform_amd64_avx
  263. + ELF(.type _gcry_sha1_transform_amd64_avx,@function)
  264. + .align 16
  265. +-_gcry_sha1_transform_amd64_avx:
  266. ++__gcry_sha1_transform_amd64_avx:
  267. + /* input:
  268. + * %rdi: ctx, CTX
  269. + * %rsi: data (64*nblks bytes)
  270. +diff -ru libgcrypt/cipher/sha1-avx-bmi2-amd64.S libgcrypt/cipher/sha1-avx-bmi2-amd64.S
  271. +--- libgcrypt/cipher/sha1-avx-bmi2-amd64.S 2016-03-23 12:59:34.000000000 +0100
  272. ++++ libgcrypt/cipher/sha1-avx-bmi2-amd64.S 2016-09-13 10:40:10.000000000 +0200
  273. +@@ -42,7 +42,11 @@
  274. +
  275. +
  276. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  277. ++#ifdef __APPLE__
  278. ++# define ELF(...) /*_*/
  279. ++#else
  280. + # define ELF(...) __VA_ARGS__
  281. ++#endif
  282. + #else
  283. + # define ELF(...) /*_*/
  284. + #endif
  285. +@@ -213,10 +217,10 @@
  286. + * size_t nblks)
  287. + */
  288. + .text
  289. +-.globl _gcry_sha1_transform_amd64_avx_bmi2
  290. ++.globl __gcry_sha1_transform_amd64_avx_bmi2
  291. + ELF(.type _gcry_sha1_transform_amd64_avx_bmi2,@function)
  292. + .align 16
  293. +-_gcry_sha1_transform_amd64_avx_bmi2:
  294. ++__gcry_sha1_transform_amd64_avx_bmi2:
  295. + /* input:
  296. + * %rdi: ctx, CTX
  297. + * %rsi: data (64*nblks bytes)
  298. diff -ru libgcrypt/cipher/sha1-ssse3-amd64.S libgcrypt/cipher/sha1-ssse3-amd64.S
  299. ---- libgcrypt/cipher/sha1-ssse3-amd64.S 2014-08-21 14:50:39.000000000 +0200
  300. -+++ libgcrypt/cipher/sha1-ssse3-amd64.S 2015-10-03 22:40:21.000000000 +0200
  301. -@@ -217,10 +217,9 @@
  302. - * _gcry_sha1_transform_amd64_ssse3 (void *ctx, const unsigned char *data)
  303. +--- libgcrypt/cipher/sha1-ssse3-amd64.S 2016-03-23 12:59:34.000000000 +0100
  304. ++++ libgcrypt/cipher/sha1-ssse3-amd64.S 2016-09-13 10:43:14.000000000 +0200
  305. +@@ -41,7 +41,11 @@
  306. +
  307. +
  308. + #ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS
  309. ++#ifdef __APPLE__
  310. ++# define ELF(...) /*_*/
  311. ++#else
  312. + # define ELF(...) __VA_ARGS__
  313. ++#endif
  314. + #else
  315. + # define ELF(...) /*_*/
  316. + #endif
  317. +@@ -227,10 +231,10 @@
  318. + * size_t nblks)
  319. */
  320. .text
  321. -.globl _gcry_sha1_transform_amd64_ssse3
  322. --.type _gcry_sha1_transform_amd64_ssse3,@function
  323. +.globl __gcry_sha1_transform_amd64_ssse3
  324. + ELF(.type _gcry_sha1_transform_amd64_ssse3,@function)
  325. .align 16
  326. -_gcry_sha1_transform_amd64_ssse3:
  327. +__gcry_sha1_transform_amd64_ssse3:
  328. /* input:
  329. * %rdi: ctx, CTX
  330. - * %rsi: data (64 bytes)
  331. + * %rsi: data (64*nblks bytes)
  332. diff --git a/contrib/src/gcrypt/work-around-libtool-limitation.patch b/contrib/src/gcrypt/work-around-libtool-limitation.patch
  333. index df97ffb488..957f268ad2 100644
  334. --- a/contrib/src/gcrypt/work-around-libtool-limitation.patch
  335. +++ b/contrib/src/gcrypt/work-around-libtool-limitation.patch
  336. @@ -1,18 +1,18 @@
  337. -diff -ru libgcrypt-broken/cipher/Makefile.am libgcrypt/cipher/Makefile.am
  338. ---- libgcrypt-broken/cipher/Makefile.am 2013-11-06 23:05:24.000000000 +0100
  339. -+++ libgcrypt/cipher/Makefile.am 2013-11-06 23:21:25.000000000 +0100
  340. +diff -ru libgcrypt/cipher/Makefile.am libgcrypt/cipher/Makefile.am
  341. +--- libgcrypt/cipher/Makefile.am 2016-08-17 13:21:22.000000000 +0200
  342. ++++ libgcrypt/cipher/Makefile.am 2016-09-12 15:13:54.000000000 +0200
  343. @@ -19,6 +19,8 @@
  344. # Process this file with automake to produce Makefile.in
  345. +LIBTOOL=@LIBTOOL@ --tag=CC
  346. +
  347. - EXTRA_DIST = Manifest
  348. -
  349. # Need to include ../src in addition to top_srcdir because gcrypt.h is
  350. -diff -ru libgcrypt-broken/mpi/Makefile.am libgcrypt/mpi/Makefile.am
  351. ---- libgcrypt-broken/mpi/Makefile.am 2013-11-06 23:05:24.000000000 +0100
  352. -+++ libgcrypt/mpi/Makefile.am 2013-11-06 23:22:04.000000000 +0100
  353. + # a built header.
  354. + AM_CPPFLAGS = -I../src -I$(top_srcdir)/src
  355. +diff -ru libgcrypt/mpi/Makefile.am libgcrypt-fixed/mpi/Makefile.am
  356. +--- libgcrypt/mpi/Makefile.am 2016-03-23 12:59:34.000000000 +0100
  357. ++++ libgcrypt/mpi/Makefile.am 2016-09-12 15:13:28.000000000 +0200
  358. @@ -23,6 +23,9 @@
  359. # Need to include ../src in addition to top_srcdir because gcrypt.h is
  360. --
  361. 2.19.1