5
5
6
6
7
7
class OpenSSLRecipe (Recipe ):
8
- version = '1.0.2h'
8
+ version = '1.1.1'
9
+ lib_version = '1.1'
9
10
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
10
11
11
12
def should_build (self , arch ):
12
- return not self .has_libs (arch , 'libssl' + self .version + '.so' ,
13
- 'libcrypto' + self .version + '.so' )
13
+ return not self .has_libs (arch , 'libssl' + self .lib_version + '.so' ,
14
+ 'libcrypto' + self .lib_version + '.so' )
14
15
15
16
def check_symbol (self , env , sofile , symbol ):
16
17
nm = env .get ('NM' , 'nm' )
@@ -22,19 +23,18 @@ def check_symbol(self, env, sofile, symbol):
22
23
return False
23
24
24
25
def get_recipe_env (self , arch = None ):
25
- env = super (OpenSSLRecipe , self ).get_recipe_env (arch )
26
- env ['OPENSSL_VERSION' ] = self .version
27
- env ['CFLAGS' ] += ' ' + env ['LDFLAGS' ]
28
- env ['CC' ] += ' ' + env ['LDFLAGS' ]
26
+ env = super (OpenSSLRecipe , self ).get_recipe_env (arch , clang = True )
27
+ env ['OPENSSL_VERSION' ] = self .lib_version
29
28
env ['MAKE' ] = 'make' # This removes the '-j5', which isn't safe
29
+ env ['ANDROID_NDK' ] = self .ctx .ndk_dir
30
30
return env
31
31
32
32
def select_build_arch (self , arch ):
33
33
aname = arch .arch
34
34
if 'arm64' in aname :
35
35
return 'linux-aarch64'
36
36
if 'v7a' in aname :
37
- return 'android-armv7 '
37
+ return 'android-arm '
38
38
if 'arm' in aname :
39
39
return 'android'
40
40
if 'x86' in aname :
@@ -48,20 +48,27 @@ def build_arch(self, arch):
48
48
# so instead we manually run perl passing in Configure
49
49
perl = sh .Command ('perl' )
50
50
buildarch = self .select_build_arch (arch )
51
- shprint (perl , 'Configure' , 'shared' , 'no-dso' , 'no-krb5' , buildarch , _env = env )
51
+ # XXX if we don't have no-asm, using clang and ndk-15c, i got:
52
+ # crypto/aes/bsaes-armv7.S:1372:14: error: immediate operand must be in the range [0,4095]
53
+ # add r8, r6, #.LREVM0SR-.LM0 @ borrow r8
54
+ # ^
55
+ # crypto/aes/bsaes-armv7.S:1434:14: error: immediate operand must be in the range [0,4095]
56
+ # sub r6, r8, #.LREVM0SR-.LSR @ pass constants
57
+ shprint (perl , 'Configure' , 'shared' , 'no-dso' , 'no-asm' , buildarch , _env = env )
52
58
self .apply_patch ('disable-sover.patch' , arch .arch )
53
- self .apply_patch ('rename-shared-lib.patch' , arch .arch )
54
59
55
60
# check_ssl = partial(self.check_symbol, env, 'libssl' + self.version + '.so')
56
- check_crypto = partial (self .check_symbol , env , 'libcrypto' + self .version + '.so' )
61
+ check_crypto = partial (self .check_symbol , env , 'libcrypto' + self .lib_version + '.so' )
57
62
while True :
58
63
shprint (sh .make , 'build_libs' , _env = env )
59
- if all (map (check_crypto , ('SSLeay' , ' MD5_Transform' , 'MD4_Init' ))):
64
+ if all (map (check_crypto , ('MD5_Transform' , 'MD4_Init' ))):
60
65
break
66
+ import time
67
+ time .sleep (3 )
61
68
shprint (sh .make , 'clean' , _env = env )
62
69
63
- self .install_libs (arch , 'libssl' + self .version + '.so' ,
64
- 'libcrypto' + self .version + '.so' )
70
+ self .install_libs (arch , 'libssl' + self .lib_version + '.so' ,
71
+ 'libcrypto' + self .lib_version + '.so' )
65
72
66
73
67
74
recipe = OpenSSLRecipe ()
0 commit comments