feat: 编译框架支持UniProton内核

Close #I5TGKH

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I18278f6efdd9682f0b3aac651a37321f30be73e1
This commit is contained in:
zhushengle
2022-09-28 17:53:18 +08:00
parent a8bedcb617
commit 1e06998be2
5 changed files with 19 additions and 5 deletions
+6
View File
@@ -90,6 +90,12 @@ group("ohos") {
"//kernel/liteos_m:build_kernel_image") {
deps += [ component_target ]
}
} else if (product_configed_component.component ==
"uniproton") {
if (component_target !=
"//kernel/uniproton:build_kernel_image") {
deps += [ component_target ]
}
} else {
deps += [ component_target ]
}
+5
View File
@@ -37,6 +37,11 @@ config("kernel_macros") {
"__LITEOS__",
"__LITEOS_M__",
]
} else if (ohos_kernel_type == "uniproton") {
defines = [
"__uniproton__",
"__UNIPROTON__",
]
} else if (ohos_kernel_type == "linux") {
defines = [
"__linux__",
+3 -2
View File
@@ -41,7 +41,8 @@ if (defined(board_configed_sysroot) && board_configed_sysroot != "") {
}
# Only gcc available for liteos_m.
if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "linux") {
if (ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton" ||
ohos_kernel_type == "linux") {
use_board_toolchain = true
}
@@ -154,7 +155,7 @@ default_shared_library_configs =
default_target_configs + [ "//build/lite/config:shared_library_config" ]
default_static_library_configs = default_target_configs
default_executable_configs = default_static_library_configs
if (ohos_kernel_type != "liteos_m") {
if (ohos_kernel_type != "liteos_m" && ohos_kernel_type != "uniproton") {
default_static_library_configs += [ "//build/lite/config:static_pie_config" ]
default_executable_configs += [ "//build/lite/config:static_pie_config" ]
default_executable_configs += [ "//build/lite/config:pie_executable_config" ]
+4 -2
View File
@@ -19,7 +19,8 @@ template("lite_library") {
target_type = invoker.target_type
shared_lib = target_type == "shared_library"
if (shared_lib && ohos_kernel_type == "liteos_m") {
if (shared_lib &&
(ohos_kernel_type == "liteos_m" || ohos_kernel_type == "uniproton")) {
group(target_name) {
if (defined(invoker.sources)) {
assert(invoker.sources != "")
@@ -57,7 +58,8 @@ template("lite_library") {
if (shared_lib) {
cflags += [ "-fPIC" ]
cflags_cc += [ "-fPIC" ]
} else if (!shared_lib && ohos_kernel_type != "liteos_m") {
} else if (!shared_lib && (ohos_kernel_type != "liteos_m" &&
ohos_kernel_type != "uniproton")) {
cflags += [ "-fPIE" ]
cflags_cc += [ "-fPIE" ]
}
+1 -1
View File
@@ -64,7 +64,7 @@ if (product_config_path != "") {
board_name = product_config.board
device_company = product_config.device_company
# Supported kernel: "liteos_a", "liteos_m", "linux"
# Supported kernel: "liteos_a", "liteos_m", "linux", "uniproton"
ohos_kernel_type = product_config.kernel_type
if (defined(product_config.kernel_is_prebuilt)) {
ohos_kernel_is_prebuilt = product_config.kernel_is_prebuilt