Add basic Darwin+Arm64 support as HOST_CROSS

Soong will use this to turn on universal binary support (X86_64 + Arm64
in the same binary).

Bug: 203607969
Test: m sdk-repo-platform-tools sdk-repo-build-tools on Mac
Change-Id: I04612136a42e85f4add95202ce20e741d9aaa302
This commit is contained in:
Dan Willemsen
2021-10-19 00:30:37 -07:00
parent 1295bc5138
commit 8820840d57
5 changed files with 13 additions and 68 deletions

View File

@@ -1,22 +0,0 @@
#
# Copyright (C) 2020 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Configuration for builds hosted on linux_arm-arm64
# Included by combo/select.mk
define $(combo_var_prefix)transform-shared-lib-to-toc
$(call _gen_toc_command_for_elf,$(1),$(2))
endef

View File

@@ -1,23 +0,0 @@
#
# Copyright (C) 2006 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Settings to use MinGW as a cross-compiler under Linux
# Included by combo/select.make
define $(combo_var_prefix)transform-shared-lib-to-toc
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OBJDUMP) -x $(1) | grep "^Name" | cut -f3 -d" " > $(2)
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)NM) -g -f p $(1) | cut -f1-2 -d" " >> $(2)
endef

View File

@@ -1,23 +0,0 @@
#
# Copyright (C) 2006 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Settings to use MinGW as a cross-compiler under Linux
# Included by combo/select.make
define $(combo_var_prefix)transform-shared-lib-to-toc
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)OBJDUMP) -x $(1) | grep "^Name" | cut -f3 -d" " > $(2)
$(hide) $($(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)NM) -g -f p $(1) | cut -f1-2 -d" " >> $(2)
endef

View File

@@ -27,6 +27,13 @@ combo_os_arch := $($(combo_target)OS)-$($(combo_target)$(combo_2nd_arch_prefix)A
combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target)
# Set reasonable defaults for the various variables
ifeq ($(combo_target),HOST_CROSS_)
$(KATI_obsolete_var \
$(combo_var_prefix)GLOBAL_ARFLAGS \
$(combo_var_prefix)STATIC_LIB_SUFFIX \
$(combo_var_prefix)transform-shared-lib-to-toc \
,HOST_CROSS builds are not supported in Make)
else
$(combo_var_prefix)GLOBAL_ARFLAGS := crsPD -format=gnu
@@ -34,3 +41,5 @@ $(combo_var_prefix)STATIC_LIB_SUFFIX := .a
# Now include the combo for this specific target.
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
endif

View File

@@ -167,6 +167,10 @@ ifeq ($(HOST_OS),linux)
else
$(error Unsupported HOST_CROSS_OS $(HOST_CROSS_OS))
endif
else ifeq ($(HOST_OS),darwin)
HOST_CROSS_OS := darwin
HOST_CROSS_ARCH := arm64
HOST_CROSS_2ND_ARCH :=
endif
ifeq ($(HOST_OS),)