Newer
Older
XinYang_IOS / Carthage / Checkouts / OpenVPNAdapter / Sources / OpenVPN3 / deps / polarssl / bignum-arm.patch
@zhangfeng zhangfeng on 7 Dec 2023 1 KB 1.8.0
diff -uNr polarssl-1.2.7/include/polarssl/bn_mul.h polarssl-1.2.7.new/include/polarssl/bn_mul.h
--- polarssl-1.2.7/include/polarssl/bn_mul.h	2013-04-13 03:56:17.000000000 -0600
+++ polarssl-1.2.7.new/include/polarssl/bn_mul.h	2013-06-13 16:30:35.000000000 -0600
@@ -548,7 +548,7 @@
 
 #if defined(__arm__)
 
-#if defined(__thumb__)
+#if defined(__thumb__) && !defined(__thumb2__)
 
 #define MULADDC_INIT                            \
     asm(                                        \
diff -uNr polarssl-1.2.7/library/bignum.c polarssl-1.2.7.new/library/bignum.c
--- polarssl-1.2.7/library/bignum.c	2013-04-13 03:56:17.000000000 -0600
+++ polarssl-1.2.7.new/library/bignum.c	2013-06-13 16:30:35.000000000 -0600
@@ -935,7 +935,15 @@
 /*
  * Helper for mpi multiplication
  */ 
-static void mpi_mul_hlp( size_t i, t_uint *s, t_uint *d, t_uint b )
+static
+#if defined(__APPLE__) && defined(__arm__)
+/*
+ * Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
+ * appears to need this to prevent bad ARM code generation at -O3.
+ */
+__attribute__ ((noinline))
+#endif
+void mpi_mul_hlp( size_t i, t_uint *s, t_uint *d, t_uint b )
 {
     t_uint c = 0, t = 0;