HOST_CROSS_OS/ARCH can be configured to linux_bionic/arm64
Previously, HOST_CROSS_OS/ARCH were fixed to windows/x86. This change makes the setting configuration and adds the support for new OS/ARCH combo: linux_bionic/arm64. linux_bionic is the Linux-based host target that uses Bionic (instead of glibc) as libc. Previously, it supported only x86_64 and the x86_64 target was NOT configured via Make, but directly via editing soong.variables file. Now, the support for arm64 is being added in the Soong side and this change makes it possible to configure the target via Make. The new HOST_CROSS_OS/ARCH combo will be used for building the host-side tools (adb, crosvm, etc.) for running Cuttlefish natively on Linux/ARM hosts. Bug: 159685774 Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m nothing Change-Id: I6b8ed8f7e26908749bbe778fbdcc34cfbde68179
This commit is contained in:
22
core/combo/HOST_CROSS_linux_bionic-arm64.mk
Normal file
22
core/combo/HOST_CROSS_linux_bionic-arm64.mk
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#
|
||||||
|
# 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
|
@@ -148,15 +148,25 @@ HOST_OS_EXTRA := $(subst $(space),-,$(HOST_OS_EXTRA))
|
|||||||
# BUILD_OS is the real host doing the build.
|
# BUILD_OS is the real host doing the build.
|
||||||
BUILD_OS := $(HOST_OS)
|
BUILD_OS := $(HOST_OS)
|
||||||
|
|
||||||
HOST_CROSS_OS :=
|
# We can do the cross-build only on Linux
|
||||||
# We can cross-build Windows binaries on Linux
|
|
||||||
ifeq ($(HOST_OS),linux)
|
ifeq ($(HOST_OS),linux)
|
||||||
ifeq ($(BUILD_HOST_static),)
|
# Windows has been the default host_cross OS
|
||||||
HOST_CROSS_OS := windows
|
ifeq (,$(filter-out windows,$(HOST_CROSS_OS)))
|
||||||
HOST_CROSS_ARCH := x86
|
# We can only create static host binaries for Linux, so if static host
|
||||||
HOST_CROSS_2ND_ARCH := x86_64
|
# binaries are requested, turn off Windows cross-builds.
|
||||||
2ND_HOST_CROSS_IS_64_BIT := true
|
ifeq ($(BUILD_HOST_static),)
|
||||||
endif
|
HOST_CROSS_OS := windows
|
||||||
|
HOST_CROSS_ARCH := x86
|
||||||
|
HOST_CROSS_2ND_ARCH := x86_64
|
||||||
|
2ND_HOST_CROSS_IS_64_BIT := true
|
||||||
|
endif
|
||||||
|
else ifeq ($(HOST_CROSS_OS),linux_bionic)
|
||||||
|
ifeq (,$(HOST_CROSS_ARCH))
|
||||||
|
$(error HOST_CROSS_ARCH missing.)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
$(error Unsupported HOST_CROSS_OS $(HOST_CROSS_OS))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HOST_OS),)
|
ifeq ($(HOST_OS),)
|
||||||
|
@@ -606,8 +606,8 @@ $(strip \
|
|||||||
$(eval modules_32 := $(patsubst %:32,%,$(filter %:32,$(2)))) \
|
$(eval modules_32 := $(patsubst %:32,%,$(filter %:32,$(2)))) \
|
||||||
$(eval modules_64 := $(patsubst %:64,%,$(filter %:64,$(2)))) \
|
$(eval modules_64 := $(patsubst %:64,%,$(filter %:64,$(2)))) \
|
||||||
$(eval modules_both := $(filter-out %:32 %:64,$(2))) \
|
$(eval modules_both := $(filter-out %:32 %:64,$(2))) \
|
||||||
$(eval ### For host cross modules, the primary arch is windows x86 and secondary is x86_64) \
|
$(eval ### if 2ND_HOST_CROSS_IS_64_BIT, then primary/secondary are reversed for HOST_CROSS modules) \
|
||||||
$(if $(filter HOST_CROSS,$(1)), \
|
$(if $(filter HOST_CROSS_true,$(1)_$(2ND_HOST_CROSS_IS_64_BIT)), \
|
||||||
$(eval modules_1st_arch := $(modules_32)) \
|
$(eval modules_1st_arch := $(modules_32)) \
|
||||||
$(eval modules_2nd_arch := $(modules_64)), \
|
$(eval modules_2nd_arch := $(modules_64)), \
|
||||||
$(eval modules_1st_arch := $(modules_64)) \
|
$(eval modules_1st_arch := $(modules_64)) \
|
||||||
|
Reference in New Issue
Block a user