[vm] Fuchsia arm64 build

Also runs the build on the existing Fuchsia bot and start building the
test .far on the bot.

Issue: https://github.com/dart-lang/sdk/issues/38752
Issue: https://github.com/dart-lang/sdk/issues/44434

TEST=tools/build.py --os=fuchsia -a arm64 create_sdk

Change-Id: I8ba92defb9318773552af7e178dea12460790004
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175482
Reviewed-by: Liam Appelbe <liama@google.com>
This commit is contained in:
Daco Harkes 2020-12-10 12:15:17 +00:00 committed by commit-bot@chromium.org
parent 64226729c1
commit 4ccb45c172
3 changed files with 25 additions and 15 deletions

View file

@ -17,9 +17,10 @@ if (use_goma) {
}
toolchain("fuchsia") {
assert(target_cpu == "x64", "We currently only support 'x64' for fuchsia.")
assert(target_cpu == "x64" || target_cpu == "arm64",
"We currently only support 'x64' and 'arm64' for fuchsia.")
toolchain_bin =
rebase_path("//buildtools/$host_os-$target_cpu/clang/bin", root_out_dir)
rebase_path("//buildtools/$host_os-x64/clang/bin", root_out_dir)
fuchsia_sdk = rebase_path("//third_party/fuchsia/sdk/$host_os", root_out_dir)
# We can't do string interpolation ($ in strings) on things with dots in
@ -34,6 +35,10 @@ toolchain("fuchsia") {
strip = "${toolchain_bin}/llvm-strip"
target_triple_flags = "--target=x86_64-fuchsia"
if (target_cpu == "arm64") {
target_triple_flags = "--target=aarch64-fuchsia"
}
sysroot_flags = "--sysroot ${fuchsia_sdk}/arch/${target_cpu}/sysroot"
lto_flags = ""
@ -129,6 +134,11 @@ toolchain("fuchsia") {
exename = "{{target_output_name}}{{output_extension}}"
outfile = "{{root_out_dir}}/$exename"
rspfile = "$outfile.rsp"
# Note that the unstripped_outfile is in the exe.stripped folder.
# We should probably clean this up, but changing this and dart.cmx
# to point ./dart instead of ./exe.stripped/dart makes the build
# fail because ./dart does not end up in the manifest file.
unstripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
command = "$compiler_prefix $ld $target_triple_flags $sysroot_flags $lto_flags {{ldflags}} -o $unstripped_outfile -Wl,--build-id -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}} && ${strip} -o $outfile $unstripped_outfile"
description = "LINK $outfile"

View file

@ -693,7 +693,6 @@
"host-checked": true
}
},
"dart2js-hostasserts-strong-mac-x64-(d8|chrome)": {
"options": {
"builder-tag": "dart2js-strong",
@ -1743,8 +1742,10 @@
"script": "tools/build.py",
"arguments": [
"--os=fuchsia",
"--arch=x64,arm64",
"runtime",
"create_sdk"
"create_sdk",
"fuchsia_test_package"
]
}
]

View file

@ -68,9 +68,7 @@ def ToCommandLine(gn_args):
def HostCpuForArch(arch):
if arch in [
'ia32', 'arm', 'armv6', 'simarm', 'simarmv6', 'simarm_x64'
]:
if arch in ['ia32', 'arm', 'armv6', 'simarm', 'simarmv6', 'simarm_x64']:
return 'x86'
if arch in ['x64', 'arm64', 'simarm64', 'arm_x64']:
return 'x64'
@ -119,6 +117,7 @@ def ParseStringMap(key, string_map):
return l[1]
return None
def UseSysroot(args, gn_args):
# Don't try to use a Linux sysroot if we aren't on Linux.
if gn_args['target_os'] != 'linux' and HOST_OS != 'linux':
@ -319,22 +318,22 @@ def ProcessOptions(args):
return False
if os_name == 'android':
if not HOST_OS in ['linux', 'macos']:
print("Cross-compilation to %s is not supported on host os %s."
% (os_name, HOST_OS))
print(
"Cross-compilation to %s is not supported on host os %s." %
(os_name, HOST_OS))
return False
if not arch in [
'ia32', 'x64', 'arm', 'arm_x64', 'armv6', 'arm64'
]:
if not arch in ['ia32', 'x64', 'arm', 'arm_x64', 'armv6', 'arm64']:
print(
"Cross-compilation to %s is not supported for architecture %s."
% (os_name, arch))
return False
elif os_name == 'fuchsia':
if HOST_OS != 'linux':
print("Cross-compilation to %s is not supported on host os %s."
% (os_name, HOST_OS))
print(
"Cross-compilation to %s is not supported on host os %s." %
(os_name, HOST_OS))
return False
if arch != 'x64':
if arch != 'x64' and arch != 'arm64':
print(
"Cross-compilation to %s is not supported for architecture %s."
% (os_name, arch))