Support linux-aarch64 host

Issue: https://gitee.com/openharmony/arkcompiler_toolchain/issues/IAZ0XR

Signed-off-by: Lyupa Anastasia <lyupa.anastasia@huawei.com>
This commit is contained in:
Lyupa Anastasia 2024-10-21 14:30:53 +03:00
parent e509ee18b9
commit 6ccac681c0
5 changed files with 31 additions and 4 deletions

View File

@ -35,7 +35,11 @@ if (check_darwin_system_result != "") {
}
if (host_os == "linux") {
host_platform_dir = "linux-x86_64"
if (host_cpu == "arm64") {
host_platform_dir = "linux-aarch64"
} else {
host_platform_dir = "linux-x86_64"
}
} else if (host_os == "mac") {
if (host_cpu == "arm64") {
host_platform_dir = "darwin-arm64"

View File

@ -412,7 +412,7 @@ config("compiler_cpu_abi") {
if (is_clang && (is_ohos || is_android)) {
ldflags += [ "-Wl,--hash-style=gnu" ]
}
if (!is_android) {
if (!is_android && !is_clang) {
cflags += [
"-march=$arm_arch",
"-mfloat-abi=$arm_float_abi",

View File

@ -28,7 +28,7 @@ declare_args() {
# Linux.
use_lld = is_clang &&
(is_win || (is_linux && current_cpu == "x64") ||
(is_linux && current_cpu == "x86") ||
(is_linux && (current_cpu == "x86" || current_cpu == "arm64")) ||
(is_ohos_or_android && (current_cpu != "arm" || arm_version >= 7)))
}

View File

@ -27,10 +27,11 @@ import("$build_root/test.gni")
ets_frontend_root = "//arkcompiler/ets_frontend"
toolchain_linux = "$build_root/toolchain/linux:clang_x64"
if (host_cpu == "arm64") {
toolchain_linux = "$build_root/toolchain/linux:clang_arm64"
toolchain_mac = "$build_root/toolchain/mac:clang_arm64"
} else {
toolchain_linux = "$build_root/toolchain/linux:clang_x64"
toolchain_mac = "$build_root/toolchain/mac:clang_x64"
}
toolchain_win = "$build_root/toolchain/mingw:mingw_x86_64"

View File

@ -48,6 +48,28 @@
"unzip_filename": "llvm"
}
]
},
"aarch64": {
"copy_config": [
{
"unzip_dir": "prebuilts/build-tools/linux-aarch64/bin",
"unzip_filename": "gn"
},
{
"unzip_dir": "prebuilts/build-tools/linux-aarch64/bin",
"unzip_filename": "ninja"
},
{
"unzip_dir": "prebuilts/ark_tools",
"unzip_filename": "ark_js_prebuilts"
}
],
"linux_copy_config": [
{
"unzip_dir": "prebuilts/clang/ohos/linux-aarch64",
"unzip_filename": "llvm"
}
]
}
},
"darwin": {