Android build fixes.
authorAndy Polyakov <appro@openssl.org>
Sun, 1 May 2016 11:35:31 +0000 (13:35 +0200)
committerAndy Polyakov <appro@openssl.org>
Mon, 2 May 2016 10:49:57 +0000 (12:49 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/10-main.conf
Configurations/unix-Makefile.tmpl
crypto/async/arch/async_posix.h

index 9d3f3ffd4ee9083649a154dc4b71335e9128a157..601dbe5e15b68b768871589c0a7e60a62f282bf3 100644 (file)
@@ -896,17 +896,14 @@ sub vms_info {
         # Special note about unconditional -fPIC and -pie. The underlying
         # reason is that Lollipop refuses to run non-PIE. But what about
         # older systems and NDKs? -fPIC was never problem, so the only
-        # concern if -pie. Older toolchains, e.g. r4, appear to handle it
+        # concern is -pie. Older toolchains, e.g. r4, appear to handle it
         # and binaries turn mostly functional. "Mostly" means that oldest
         # Androids, such as Froyo, fail to handle executable, but newer
         # systems are perfectly capable of executing binaries targeting
         # Froyo. Keep in mind that in the nutshell Android builds are
         # about JNI, i.e. shared libraries, not applications.
-        cflags           => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
-                                   debug   => "-O0 -g",
-                                   release => "-O3"),
-        lflags           => "-pie",
-        shared_cflag     => "",
+        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
+        bin_cflags       => "-pie",
     },
     "android-x86" => {
         inherit_from     => [ "android", asm("x86_asm") ],
@@ -945,11 +942,8 @@ sub vms_info {
 
     "android64" => {
         inherit_from     => [ "linux-generic64" ],
-        cflags           => picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack -Wall",
-                                   debug   => "-O0 -g",
-                                   release => "-O3"),
-        lflags           => "-pie",
-        shared_cflag     => "",
+        cflags           => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
+        bin_cflags       => "-pie",
     },
     "android64-aarch64" => {
         inherit_from     => [ "android64", asm("aarch64_asm") ],
index 164b533f22e47f601cf942ca6d032739c5bf2415..974a978fb3ebf8f8689cc92fa977ec66231dc6fa 100644 (file)
@@ -172,7 +172,7 @@ LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag}
 RCFLAGS={- $target{shared_rcflag} -}
 DSO_CFLAGS={- $target{shared_cflag} || "" -}
 DSO_LDFLAGS=$(LIB_LDFLAGS)
-BIN_CFLAGS={- "" -}
+BIN_CFLAGS={- $target{bin_cflags} -}
 
 PERL={- $config{perl} -}
 
index de80f95f9d44fe5949e2d7b23bd7181252320f3e..1a611bab3c338580188cea2d7b27a5552571bca5 100644 (file)
@@ -53,7 +53,7 @@
 #define OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
 #include <openssl/e_os2.h>
 
-#if (defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_CYGWIN)) && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC)
+#if (defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_CYGWIN)) && defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) && !defined(__ANDROID__)
 
 # include <unistd.h>