Commit 131568b8 authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

fuchsia: Roll SDK to 2bebd264dfe3bec89469a4179a8292b416cdf2fa

Not the normal simple update-the-hash SDK update. Changes:

- Use our own libunwind (as it's been removed from the Fuchsia SDK);

- Use the toolchain hash as a version #define instead of the .stamp in
  sysroot (which has been removed). The Fuchsia team builds with -MD to
  cause rebuilds after ABI changes, Chromium builds with -MMD. The
  global define ensures we rebuild on SDK updates;

- Update clang version to '6.0.0' to get correct builtins lib;

- Update docs for pulling SDK from prebuilt package, rather than doing
  local builds.

- Don't include libc++ and libunwind .so into the runner disk image, as
  we link to them statically now.

Bug: 707030, 750392
Change-Id: I6702ce208e23288107db00d80f4bed7f875820ae
Reviewed-on: https://chromium-review.googlesource.com/594270
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491035}
parent ef1abe78
......@@ -1218,7 +1218,7 @@ hooks_os = {
'action': [
'python',
'src/build/fuchsia/update_sdk.py',
'79326d8c556f621c815ebb7d24e34054f43ba1a5',
'2bebd264dfe3bec89469a4179a8292b416cdf2fa',
],
},
],
......
......@@ -18,7 +18,9 @@ config("c++flags") {
"-isystem" + rebase_path("$libcxx_prefix/include", root_build_dir),
"-isystem" + rebase_path("$libcxxabi_prefix/include", root_build_dir),
]
if (is_linux && current_cpu == "arm") {
# This condition should match the one in buildtools/third_party/libc++abi.
if ((is_linux && current_cpu == "arm") || is_fuchsia) {
cflags_c = [ "-isystem" +
rebase_path("$libunwind_prefix/include", root_build_dir) ]
cflags_cc += [ "-isystem" +
......@@ -49,10 +51,10 @@ config("c++flags") {
# the SDK, https://crbug.com/724204
# If clang grows a flag like -nodefaultlibs++, then this here should use
# -resource-dir instead.
# Note: Intentionally 5.0.0 instead of $clang_version because the clang
# Note: Intentionally 6.0.0 instead of $clang_version because the clang
# version of the toolchain_libs directory in the Fuchsia SDK can be
# different from the version of Chromium's clang.
lib_dirs = [ "$fuchsia_sdk/toolchain_libs/clang/5.0.0/lib/fuchsia" ]
lib_dirs = [ "$fuchsia_sdk/toolchain_libs/clang/6.0.0/lib/fuchsia" ]
# TODO(fuchsia): We probably want to support more archs one day.
libs += [ "clang_rt.builtins-x86_64" ]
......
......@@ -9,9 +9,11 @@ assert(is_fuchsia)
assert(is_posix)
config("compiler") {
sdk_version_file = rebase_path("$fuchsia_sdk/.hash")
sdk_version = read_file(sdk_version_file, "trim string")
defines = [
# To force full builds after sysroot updates.
"SYSROOT_VERSION=$sysroot_version",
# To force full builds after SDK updates in case of ABI changes.
"FUCHSIA_SDK_VERSION=$sdk_version",
]
cflags = []
ldflags = []
......@@ -37,6 +39,5 @@ config("compiler") {
libs = [
"mxio",
"magenta",
"unwind",
]
}
......@@ -85,8 +85,6 @@ if (current_os == target_os && current_cpu == target_cpu &&
} else {
sysroot = ""
}
sysroot_stamp = rebase_path("$sysroot/.stamp")
sysroot_version = read_file(sysroot_stamp, "trim string")
} else {
sysroot = ""
}
......@@ -119,17 +119,6 @@ def BuildBootfs(output_directory, runtime_deps_path, test_name, child_args,
for loc in locations_to_add],
locations_to_add)
# Add extra .so's that are required for running to system/lib
sysroot_libs = [
'libc++abi.so.1',
'libc++.so.2',
'libunwind.so.1',
]
sysroot_lib_path = os.path.join(SDK_ROOT, 'sysroot', 'x86_64-fuchsia', 'lib')
for lib in sysroot_libs:
target_source_pairs.append(
('lib/' + lib, os.path.join(sysroot_lib_path, lib)))
if test_launcher_filter_file:
test_launcher_filter_file = os.path.normpath(
os.path.join(output_directory, test_launcher_filter_file))
......
# Publishing a new Fuchsia SDK, and updating Chrome to use it
Updating the Fuchsia SDK in Chromium currently involves:
1. Building and testing the latest Fuchsia version.
0. Packaging the SDK from that and uploading to cloud storage.
0. Updating Chromium with DEPS and any other changes to build with the new SDK.
## Build and test Fuchsia
For current documentation on Fuchsia setup, visit the [Fuchsia Getting Started Guide](https://fuchsia.googlesource.com/docs/+/HEAD/getting_started.md).
Perform these steps on your Linux workstation:
1. Check if fuchsia-dashboard.appspot.com looks green.
0. Fetch the latest Fuchsia source.
$ jiri update
0. Build Magenta, the sysroot, and Fuchsia.
$ fbuild
Now verify that the build is stable:
1. Either: Boot the build in QEMU - you will probably want to use -k to enable KVM acceleration (see the guide for details of other options to enable networking, graphics, etc).
$ frun -k
0. Or (preferably): Boot the build on hardware (see the guide for details of first-time setup).
$ fboot
0. Run tests to verify the build. All the tests should pass! If they don't then find out which of the test fixtures is failing and ping #cr-fuchsia on IRC to determine if it's a known issue.
$ runtests
## Build and upload the SDK
1. Configure and build a release mode build with sdk config:
$ ./packages/gn/gen.py --release --goma -m runtime,runtime_config,netstack
$ ./packages/gn/build.py --release -j1000
0. Package the sysroot and tools.
$ ./scripts/makesdk.go .
0. Compute the SHA-1 hash of the tarball, to use as its filename.
$ sha1sum fuchsia-sdk.tgz
f79f55be4e69ebd90ea84f79d7322525853256c3
0. Note that it's possible to un-tar the SDK into place in your Chromium checkout at this point, for testing, and skip to the Build & Test steps below, before doing the actual upload.
0. (Googlers only) Upload the tarball to the fuchsia-build build, under the SDK path. This will require "create" access to the bucket, which is restricted to Googlers, and you'll need to have authenticated to the gcloud tools with OAuth.
$ gsutil.py cp fuchsia-sdk.tgz gs://fuchsia-build/fuchsia/sdk/linux64/f79f55be4e69ebd90ea84f79d7322525853256c
## Update & test Chromium
1. Update the fuchsia SDK line in top-level DEPS with the new hash.
0. Fetch the new SDK.
$ gclient sync
0. Build & test.
$ ninja -C out/gnRelease ... <check build-bots for current targets> ...
0. Make necessary changes to fix build, to include in the roll CL. You may find problems in dependencies of Chromium, in which case you'll need to fix those, get the dependency rolled, and then try again.
0. Upload the roll CL for review! Remember to run the Fuchsia try-bots over the patch-set before landing it.
# Updating Chromium to a new Fuchsia SDK
1. Check the [Fuchsia-side
job](https://luci-scheduler.appspot.com/jobs/fuchsia/sdk-x86_64-linux) for a
recent green archive. On the "SUCCEEDED" link, copy the SHA-1 from the
`gsutil.upload` link of the `upload fuchsia-sdk` step.
0. Put that into Chromium's src.git DEPS in the `fuchsia_sdk` step.
0. `gclient sync && ninja ...` and make sure things go OK locally.
0. Upload the roll CL, making sure to include the `fuchsia` trybot. Tag the roll
with `Bug: 707030`.
(Old revisions of this document have the old manual steps for building a Fuchsia
SDK if for some reason you want to do that locally. They'll probably
increasingly go out of date as the steps for building the SDK changes though.)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment