Debian Codegraph @

Build_android/openssl/openssl-1.1.0g.patch

raw
1 This patch applies several changes that enable OpenSSL 1.1.0g to be built
2 for Android using either Clang or GCC toolchains.
3
4 diff -Naur org/Configurations/10-main.conf mod/Configurations/10-main.conf
5 --- org/Configurations/10-main.conf 2017-11-02 07:29:01.000000000 -0700
6 +++ mod/Configurations/10-main.conf 2018-01-18 10:59:41.675138500 -0800
7 @@ -910,15 +910,27 @@
8 # systems are perfectly capable of executing binaries targeting
9 # Froyo. Keep in mind that in the nutshell Android builds are
10 # about JNI, i.e. shared libraries, not applications.
11 - cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
12 + cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(ANDROID_LINK_SYSROOT) -isystem \$(ANDROID_SYSROOT)/usr/include -isystem \$(ANDROID_SYSROOT)/usr/include/\$(ANDROID_TRIPLE) -D__ANDROID_API__=\$(ANDROID_API) -Wa,--noexecstack")),
13 bin_cflags => "-pie",
14 },
15 + "android-clang" => {
16 + inherit_from => [ "linux-generic32" ],
17 + cc => "clang",
18 + cflags => add(picker(default => "-fPIC --gcc-toolchain=\$(ANDROID_GCC_TOOLCHAIN) --sysroot=\$(ANDROID_LINK_SYSROOT) -isystem \$(ANDROID_SYSROOT)/usr/include -isystem \$(ANDROID_SYSROOT)/usr/include/\$(ANDROID_TRIPLE) -D__ANDROID_API__=\$(ANDROID_API) -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Qunused-arguments -Wa,--noexecstack")),
19 +},
20 "android-x86" => {
21 inherit_from => [ "android", asm("x86_asm") ],
22 cflags => add(picker(release => "-fomit-frame-pointer")),
23 bn_ops => "BN_LLONG",
24 perlasm_scheme => "android",
25 },
26 + "android-x86-clang" => {
27 + inherit_from => [ "android-clang", asm("x86_asm") ],
28 + cflags => add(picker(default => "-target i686-none-linux-android",
29 + release => "-fomit-frame-pointer")),
30 + bn_ops => "BN_LLONG",
31 + perlasm_scheme => "android",
32 + },
33 ################################################################
34 # Contemporary Android applications can provide multiple JNI
35 # providers in .apk, targeting multiple architectures. Among
36 @@ -943,20 +955,38 @@
37 "android-armeabi" => {
38 inherit_from => [ "android", asm("armv4_asm") ],
39 },
40 + "android-armeabi-clang" => {
41 + inherit_from => [ "android-clang", asm("armv4_asm") ],
42 + cflags => add("-target armv7-none-linux-androideabi"),
43 + },
44 "android-mips" => {
45 inherit_from => [ "android", asm("mips32_asm") ],
46 perlasm_scheme => "o32",
47 },
48 -
49 + "android-mips-clang" => {
50 + inherit_from => [ "android-clang", asm("mips32_asm") ],
51 + cflags => add("-target mipsel-none-linux-android"),
52 + perlasm_scheme => "o32",
53 + },
54 "android64" => {
55 inherit_from => [ "linux-generic64" ],
56 - cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
57 + cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(ANDROID_LINK_SYSROOT) -isystem \$(ANDROID_SYSROOT)/usr/include -isystem \$(ANDROID_SYSROOT)/usr/include/\$(ANDROID_TRIPLE) -D__ANDROID_API__=\$(ANDROID_API) -Wa,--noexecstack")),
58 bin_cflags => "-pie",
59 },
60 + "android64-clang" => {
61 + inherit_from => [ "linux-generic64" ],
62 + cc => "clang",
63 + cflags => add(picker(default => "-fPIC --gcc-toolchain=\$(ANDROID_GCC_TOOLCHAIN) --sysroot=\$(ANDROID_LINK_SYSROOT) -isystem \$(ANDROID_SYSROOT)/usr/include -isystem \$(ANDROID_SYSROOT)/usr/include/\$(ANDROID_TRIPLE) -D__ANDROID_API__=\$(ANDROID_API) -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Qunused-arguments -Wa,--noexecstack")),
64 + },
65 "android64-aarch64" => {
66 inherit_from => [ "android64", asm("aarch64_asm") ],
67 perlasm_scheme => "linux64",
68 },
69 + "android64-aarch64-clang" => {
70 + inherit_from => [ "android64-clang", asm("aarch64_asm") ],
71 + cflags => add("-target aarch64-none-linux-android"),
72 + perlasm_scheme => "linux64",
73 + },
74
75 #### *BSD
76 "BSD-generic32" => {