summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2020-12-29 22:01:50 -0600
committerFred Hornsey <hornseyf@objectcomputing.com>2020-12-29 22:01:50 -0600
commit1d5ef81d1eb0b38cad6628e9efca36778945b2ab (patch)
tree039c4e2d7d680e6d722a8a6c9e928c855b0c2880
parentb7088652c6b5621f975dcd6b1699fc41fa3d8cc5 (diff)
downloadATCD-1d5ef81d1eb0b38cad6628e9efca36778945b2ab.tar.gz
Fix Older NDKs Not Having armv7a-* Prefixed Tools
Will have to check for them or fallback to the arm-* prefix.
-rw-r--r--ACE/include/makeinclude/platform_android.GNU20
-rw-r--r--ACE/include/makeinclude/platform_clang_common.GNU2
-rw-r--r--ACE/include/makeinclude/platform_g++_common.GNU2
3 files changed, 19 insertions, 5 deletions
diff --git a/ACE/include/makeinclude/platform_android.GNU b/ACE/include/makeinclude/platform_android.GNU
index db39bf09eb2..41eab6cfba9 100644
--- a/ACE/include/makeinclude/platform_android.GNU
+++ b/ACE/include/makeinclude/platform_android.GNU
@@ -104,18 +104,32 @@ ifdef android_ndk
android_ndk_tool_prefix := $(CROSS_COMPILE)$(android_api)-
endif
- # We dont want this being used again except to signal that this is a
- # cross-compile build. If it is this command (probably) wont exist.
+ # We don't want this being used again except to signal that this is a
+ # cross-compile build. If it is then the resulting command (probably) wont
+ # exist.
CROSS_COMPILE := THIS_VALUE_SHOULD_NOT_BE_USED
+ # Ignore value of CROSS_COMPILE because ar doesn't match clang like in
+ # platform_clang_common.GNU.
override_cross_compile = 1
CC = $(android_ndk_tools)/$(android_ndk_tool_prefix)clang
CXX = $(android_ndk_tools)/$(android_ndk_tool_prefix)clang++
AR = $(android_ndk_tools)/llvm-ar
-else
+else # Standalone Toolchain
CROSS_COMPILE := $(CROSS_COMPILE)-
+ ifeq ($(android_abi),armeabi-v7a)
+ # According to Google the armv7a-linux-androideabi- prefix should be
+ # preferred because it produces more efficient code. However if it doesn't
+ # exist since we're using an older NDK we have to fallback to
+ # arm-linux-androideabi-. This isn't a problem when directly using the NDK
+ # because the NDKs we support for that have armv7a-* clangs.
+ ifeq (,$(shell command -v $(CROSS_COMPILE)clang $(ACE_NUL_STDERR)))
+ CROSS_COMPILE := arm-linux-androideabi-
+ endif
+ endif
+
# Export so child processes can use tools from the same toolchain.
export CROSS_COMPILE
endif
diff --git a/ACE/include/makeinclude/platform_clang_common.GNU b/ACE/include/makeinclude/platform_clang_common.GNU
index b6d6c43bf61..bb42962e042 100644
--- a/ACE/include/makeinclude/platform_clang_common.GNU
+++ b/ACE/include/makeinclude/platform_clang_common.GNU
@@ -23,7 +23,7 @@ ifneq ($(CROSS_COMPILE),)
TAO_IDL3_TO_IDL2_DEP = $(TAO_IDL3_TO_IDL2)
TAO_IDL3_TO_XMI = $(HOST_ROOT)/bin/tao_idl3_to_xmi
TAO_IDL3_TO_XMI_DEP = $(TAO_IDL3_TO_XMI)
- # make sure to use the target compiler, not the cross-compiler
+ # make sure to use the host compiler, not the cross-compiler
# as preprocessor for the cross-compiled idl tools
TAO_IDL_PREPROCESSOR = clang
endif
diff --git a/ACE/include/makeinclude/platform_g++_common.GNU b/ACE/include/makeinclude/platform_g++_common.GNU
index df5622c20e6..b439336cb81 100644
--- a/ACE/include/makeinclude/platform_g++_common.GNU
+++ b/ACE/include/makeinclude/platform_g++_common.GNU
@@ -26,7 +26,7 @@ else
TAO_IDL3_TO_IDL2_DEP = $(TAO_IDL3_TO_IDL2)
TAO_IDL3_TO_XMI = $(HOST_ROOT)/bin/tao_idl3_to_xmi
TAO_IDL3_TO_XMI_DEP = $(TAO_IDL3_TO_XMI)
- # make sure to use the target compiler, not the cross-compiler
+ # make sure to use the host compiler, not the cross-compiler
# as preprocessor for the cross-compiled idl tools
TAO_IDL_PREPROCESSOR = gcc
endif