From b531a36dde620077e6062a05ef257687886dfe54 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Mon, 18 Sep 2017 21:25:04 +0000 Subject: [PATCH] fuchsia: Magenta -> Zircon Includes a Fuchsia SDK update, and a lot of mx_ -> zx_, et al. Sets CHROMIUM_ROLLING_MAGENTA_TO_ZIRCON=1 as a global define temporarily to support for 3-sided rolls of third_party DEPS. Requires https://chromium-review.googlesource.com/c/v8/v8/+/668751 to have landed and rolled. Requires boringssl roll with similar change to have landed https://chromium-review.googlesource.com/c/chromium/src/+/668704. R=dcheng@chromium.org,nick@chromium.org,tsepez@chromium.org,rockot@chromium.org TBR=nick@chromium.org Bug: 765754, 707030 Change-Id: I6c2ad37b3c5b13c2a3a98da6e1ff9160ad2de949 Reviewed-on: https://chromium-review.googlesource.com/669139 Commit-Queue: Scott Graham Reviewed-by: David Benjamin Reviewed-by: Tom Sepez Reviewed-by: Ken Rockot Reviewed-by: Daniel Cheng Cr-Original-Commit-Position: refs/heads/master@{#502678} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: fe0e9f46ab247ff5a28a823f344c93230953018f --- config/fuchsia/BUILD.gn | 29 ++++++++++++++++++++++------- fuchsia/runner_common.py | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/config/fuchsia/BUILD.gn b/config/fuchsia/BUILD.gn index 23bbdf102..e55318225 100644 --- a/config/fuchsia/BUILD.gn +++ b/config/fuchsia/BUILD.gn @@ -14,6 +14,11 @@ config("compiler") { defines = [ # To force full builds after SDK updates in case of ABI changes. "FUCHSIA_SDK_VERSION=$sdk_version", + + # TODO(scottmg): Temporary during 3-sided rolls. https://crbug.com/765754. + # When this is set, defines/typedefs are in effect to convert "mx_"s to + # "zx_"s. + "CHROMIUM_ROLLING_MAGENTA_TO_ZIRCON=1", ] cflags = [] ldflags = [] @@ -21,7 +26,17 @@ config("compiler") { cflags += [ "--target=aarch64-fuchsia" ] ldflags += [ "--target=aarch64-fuchsia" ] } else if (current_cpu == "x64") { - cflags += [ "--target=x86_64-fuchsia" ] + cflags += [ + "--target=x86_64-fuchsia", + + # TODO(scottmg): I screwed up in + # https://chromium.googlesource.com/v8/v8.git/+/aabb893a3259c72a78920771280d0832411c92c1 + # (and put #undef mx_ zx_ rather than just #undef mx_). It took 4 days to + # get that landed upstream, so instead of fixing and waiting again (since + # that code will be deleted right after this lands), simply turn off + # this warning temporarily. https://crbug.com/765754. + "-Wno-extra-tokens", + ] ldflags += [ "--target=x86_64-fuchsia" ] } else { assert(false, "Unsupported architecture") @@ -40,20 +55,20 @@ config("compiler") { rebase_path(fuchsia_sdk, root_build_dir) + "/toolchain_libs/clang/6.0.0", # The stack defaults to 256k on Fuchsia (see - # https://fuchsia.googlesource.com/magenta/+/master/system/private/magenta/stack.h#9), + # https://fuchsia.googlesource.com/zircon/+/master/system/private/zircon/stack.h#9), # but on other platforms it's much higher, so a variety of code assumes more # will be available. Raise to 8M which matches e.g. macOS. "-Wl,-z,stack-size=0x800000", - # We always want mxio or else e.g. stdio wouldn't be initialized if mxio + # We always want fdio or else e.g. stdio wouldn't be initialized if fdio # happens to not be directly referenced. The common POSIX-y compiler setup - # uses -Wl,--as-needed which drops it if it's simply "-lmxio" from a libs - # setting. Disable --as-needed, add mxio, and then set back to --as-needed. + # uses -Wl,--as-needed which drops it if it's simply "-lfdio" from a libs + # setting. Disable --as-needed, add fdio, and then set back to --as-needed. # https://crbug.com/731217. "-Wl,--no-as-needed", - "-lmxio", + "-lfdio", "-Wl,--as-needed", ] - libs = [ "magenta" ] + libs = [ "zircon" ] } diff --git a/fuchsia/runner_common.py b/fuchsia/runner_common.py index 2eb94fb8b..9055ba99e 100755 --- a/fuchsia/runner_common.py +++ b/fuchsia/runner_common.py @@ -361,7 +361,7 @@ def _GetResultsFromImg(dry_run, test_launcher_summary_output): def RunFuchsia(bootfs_data, use_device, dry_run, test_launcher_summary_output): - kernel_path = os.path.join(SDK_ROOT, 'kernel', 'magenta.bin') + kernel_path = os.path.join(SDK_ROOT, 'kernel', 'zircon.bin') if use_device: # TODO(fuchsia): This doesn't capture stdout as there's no way to do so