From 08c381b8b2aab3191400bfae5b3383ae22f59520 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Mon, 12 Jun 2023 15:33:09 +0100 Subject: [PATCH] Add riscv64 banchan target. Test: banchan riscv64 com.android.art Test: build/soong/build_test.bash --dist -products module_riscv64 Bug: 271573990 Change-Id: I6aa8c51b1a1928b3da52a9345a8bfb84e3eb11d0 --- envsetup.sh | 9 +++++---- target/board/module_riscv64/BoardConfig.mk | 22 ++++++++++++++++++++++ target/board/module_riscv64/README.md | 2 ++ target/product/AndroidProducts.mk | 1 + target/product/module_riscv64.mk | 21 +++++++++++++++++++++ 5 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 target/board/module_riscv64/BoardConfig.mk create mode 100644 target/board/module_riscv64/README.md create mode 100644 target/product/module_riscv64.mk diff --git a/envsetup.sh b/envsetup.sh index d292dbb3ad..f4755dd336 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -62,8 +62,8 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y invocations of 'm' etc. - tapas: tapas [ ...] [arm|x86|arm64|x86_64] [eng|userdebug|user] Sets up the build environment for building unbundled apps (APKs). -- banchan: banchan [ ...] [arm|x86|arm64|x86_64|arm64_only|x86_64only] \ - [eng|userdebug|user] +- banchan: banchan [ ...] \ + [arm|x86|arm64|riscv64|x86_64|arm64_only|x86_64only] [eng|userdebug|user] Sets up the build environment for building unbundled modules (APEXes). - croot: Changes directory to the top of the tree, or a subdirectory thereof. - m: Makes from the top of the tree. @@ -952,9 +952,9 @@ function tapas() function banchan() { local showHelp="$(echo $* | xargs -n 1 echo | \grep -E '^(help)$' | xargs)" - local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|x86_64|arm64only|x86_64only)$' | xargs)" + local product="$(echo $* | xargs -n 1 echo | \grep -E '^(.*_)?(arm|x86|arm64|riscv64|x86_64|arm64only|x86_64only)$' | xargs)" local variant="$(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$' | xargs)" - local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|x86_64))$' | xargs)" + local apps="$(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng|(.*_)?(arm|x86|arm64|riscv64|x86_64))$' | xargs)" if [ "$showHelp" != "" ]; then $(gettop)/build/make/banchanHelp.sh @@ -980,6 +980,7 @@ function banchan() arm) product=module_arm;; x86) product=module_x86;; arm64) product=module_arm64;; + riscv64) product=module_riscv64;; x86_64) product=module_x86_64;; arm64only) product=module_arm64only;; x86_64only) product=module_x86_64only;; diff --git a/target/board/module_riscv64/BoardConfig.mk b/target/board/module_riscv64/BoardConfig.mk new file mode 100644 index 0000000000..8bc1999dfe --- /dev/null +++ b/target/board/module_riscv64/BoardConfig.mk @@ -0,0 +1,22 @@ +# Copyright (C) 2023 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. +# + +TARGET_ARCH := riscv64 +TARGET_ARCH_VARIANT := +TARGET_CPU_VARIANT := generic +TARGET_CPU_ABI := riscv64 + +# Temporary hack while prebuilt modules are missing riscv64. +ALLOW_MISSING_DEPENDENCIES := true diff --git a/target/board/module_riscv64/README.md b/target/board/module_riscv64/README.md new file mode 100644 index 0000000000..edebaa9f80 --- /dev/null +++ b/target/board/module_riscv64/README.md @@ -0,0 +1,2 @@ +This device is suitable for an unbundled module targeted specifically to a +riscv64 device. This is a 64-bit only device (no 32-bit support). diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk index 133dc7354e..473a27555f 100644 --- a/target/product/AndroidProducts.mk +++ b/target/product/AndroidProducts.mk @@ -83,6 +83,7 @@ PRODUCT_MAKEFILES += \ $(LOCAL_DIR)/module_arm.mk \ $(LOCAL_DIR)/module_arm64.mk \ $(LOCAL_DIR)/module_arm64only.mk \ + $(LOCAL_DIR)/module_riscv64.mk \ $(LOCAL_DIR)/module_x86.mk \ $(LOCAL_DIR)/module_x86_64.mk \ $(LOCAL_DIR)/module_x86_64only.mk \ diff --git a/target/product/module_riscv64.mk b/target/product/module_riscv64.mk new file mode 100644 index 0000000000..4fd38c063c --- /dev/null +++ b/target/product/module_riscv64.mk @@ -0,0 +1,21 @@ +# +# Copyright (C) 2023 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. +# + +$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) + +PRODUCT_NAME := module_riscv64 +PRODUCT_DEVICE := module_riscv64