mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[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:
parent
64226729c1
commit
4ccb45c172
|
@ -17,9 +17,10 @@ if (use_goma) {
|
||||||
}
|
}
|
||||||
|
|
||||||
toolchain("fuchsia") {
|
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 =
|
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)
|
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
|
# We can't do string interpolation ($ in strings) on things with dots in
|
||||||
|
@ -34,6 +35,10 @@ toolchain("fuchsia") {
|
||||||
strip = "${toolchain_bin}/llvm-strip"
|
strip = "${toolchain_bin}/llvm-strip"
|
||||||
|
|
||||||
target_triple_flags = "--target=x86_64-fuchsia"
|
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"
|
sysroot_flags = "--sysroot ${fuchsia_sdk}/arch/${target_cpu}/sysroot"
|
||||||
lto_flags = ""
|
lto_flags = ""
|
||||||
|
|
||||||
|
@ -129,6 +134,11 @@ toolchain("fuchsia") {
|
||||||
exename = "{{target_output_name}}{{output_extension}}"
|
exename = "{{target_output_name}}{{output_extension}}"
|
||||||
outfile = "{{root_out_dir}}/$exename"
|
outfile = "{{root_out_dir}}/$exename"
|
||||||
rspfile = "$outfile.rsp"
|
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"
|
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"
|
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"
|
description = "LINK $outfile"
|
||||||
|
|
|
@ -693,7 +693,6 @@
|
||||||
"host-checked": true
|
"host-checked": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"dart2js-hostasserts-strong-mac-x64-(d8|chrome)": {
|
"dart2js-hostasserts-strong-mac-x64-(d8|chrome)": {
|
||||||
"options": {
|
"options": {
|
||||||
"builder-tag": "dart2js-strong",
|
"builder-tag": "dart2js-strong",
|
||||||
|
@ -1743,8 +1742,10 @@
|
||||||
"script": "tools/build.py",
|
"script": "tools/build.py",
|
||||||
"arguments": [
|
"arguments": [
|
||||||
"--os=fuchsia",
|
"--os=fuchsia",
|
||||||
|
"--arch=x64,arm64",
|
||||||
"runtime",
|
"runtime",
|
||||||
"create_sdk"
|
"create_sdk",
|
||||||
|
"fuchsia_test_package"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
21
tools/gn.py
21
tools/gn.py
|
@ -68,9 +68,7 @@ def ToCommandLine(gn_args):
|
||||||
|
|
||||||
|
|
||||||
def HostCpuForArch(arch):
|
def HostCpuForArch(arch):
|
||||||
if arch in [
|
if arch in ['ia32', 'arm', 'armv6', 'simarm', 'simarmv6', 'simarm_x64']:
|
||||||
'ia32', 'arm', 'armv6', 'simarm', 'simarmv6', 'simarm_x64'
|
|
||||||
]:
|
|
||||||
return 'x86'
|
return 'x86'
|
||||||
if arch in ['x64', 'arm64', 'simarm64', 'arm_x64']:
|
if arch in ['x64', 'arm64', 'simarm64', 'arm_x64']:
|
||||||
return 'x64'
|
return 'x64'
|
||||||
|
@ -119,6 +117,7 @@ def ParseStringMap(key, string_map):
|
||||||
return l[1]
|
return l[1]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def UseSysroot(args, gn_args):
|
def UseSysroot(args, gn_args):
|
||||||
# Don't try to use a Linux sysroot if we aren't on Linux.
|
# Don't try to use a Linux sysroot if we aren't on Linux.
|
||||||
if gn_args['target_os'] != 'linux' and HOST_OS != 'linux':
|
if gn_args['target_os'] != 'linux' and HOST_OS != 'linux':
|
||||||
|
@ -319,22 +318,22 @@ def ProcessOptions(args):
|
||||||
return False
|
return False
|
||||||
if os_name == 'android':
|
if os_name == 'android':
|
||||||
if not HOST_OS in ['linux', 'macos']:
|
if not HOST_OS in ['linux', 'macos']:
|
||||||
print("Cross-compilation to %s is not supported on host os %s."
|
print(
|
||||||
% (os_name, HOST_OS))
|
"Cross-compilation to %s is not supported on host os %s." %
|
||||||
|
(os_name, HOST_OS))
|
||||||
return False
|
return False
|
||||||
if not arch in [
|
if not arch in ['ia32', 'x64', 'arm', 'arm_x64', 'armv6', 'arm64']:
|
||||||
'ia32', 'x64', 'arm', 'arm_x64', 'armv6', 'arm64'
|
|
||||||
]:
|
|
||||||
print(
|
print(
|
||||||
"Cross-compilation to %s is not supported for architecture %s."
|
"Cross-compilation to %s is not supported for architecture %s."
|
||||||
% (os_name, arch))
|
% (os_name, arch))
|
||||||
return False
|
return False
|
||||||
elif os_name == 'fuchsia':
|
elif os_name == 'fuchsia':
|
||||||
if HOST_OS != 'linux':
|
if HOST_OS != 'linux':
|
||||||
print("Cross-compilation to %s is not supported on host os %s."
|
print(
|
||||||
% (os_name, HOST_OS))
|
"Cross-compilation to %s is not supported on host os %s." %
|
||||||
|
(os_name, HOST_OS))
|
||||||
return False
|
return False
|
||||||
if arch != 'x64':
|
if arch != 'x64' and arch != 'arm64':
|
||||||
print(
|
print(
|
||||||
"Cross-compilation to %s is not supported for architecture %s."
|
"Cross-compilation to %s is not supported for architecture %s."
|
||||||
% (os_name, arch))
|
% (os_name, arch))
|
||||||
|
|
Loading…
Reference in a new issue