From 1d5ef81d1eb0b38cad6628e9efca36778945b2ab Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Tue, 29 Dec 2020 22:01:50 -0600 Subject: Fix Older NDKs Not Having armv7a-* Prefixed Tools Will have to check for them or fallback to the arm-* prefix. --- ACE/include/makeinclude/platform_android.GNU | 20 +++++++++++++++++--- ACE/include/makeinclude/platform_clang_common.GNU | 2 +- ACE/include/makeinclude/platform_g++_common.GNU | 2 +- 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 -- cgit v1.2.1