New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750392 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 707030



Sign in to add a comment

Can't currently roll Fuchsia SDK

Project Member Reported by scottmg@chromium.org, Jul 29 2017

Issue description

The Fuchsia SDK has in some ways, and we need to update some stuff on the Chrome side wrt to toolchains it seems.

The "simple" update the deps cl was here:
https://chromium-review.googlesource.com/c/592508

Things that have changed:

- no more .stamp file in the sysroot. This was used to set a global define so that things would rebuild if there was an ABI change. Fuchsia uses -MD instead of -MMD (assuming that a system include would change if there were an ABI change). I don't know if there's a good reason why chrome uses MMD, brettw probably wrote that but copied it from old gyp.

- the path to the builtins lib is now 6.0.0, not 5.0.0, this seems to match our clang so maybe just change that (or possibly the next thing...)

- libunwind is no longer in the fuchsia sdk along with some others that are now in the fuchsia toolchain which we don't use https://gist.github.com/anonymous/2236ad4e74bcc600ff62c0638ba4d63e. I gather we should be using our own libc++ libunwind and maybe libbuiltins_rt now too.
 
Components: Internals>PlatformIntegration

Comment 3 by thakis@chromium.org, Jul 31 2017

- not sure what .stamp and -MD have to do with each other, but we could use the SDK's hash as part of the include path like on Windows, or ask jamesr to put a .stamp file back. Evan used -MMD long ago in gyp days, probably because system headers usually don't change and it keeps deps size down.

- yes, just need to update the number here https://chromium.googlesource.com/chromium/src/+/1c688af81fcfa4c072dcca79e698641839e8a42f/build/config/c++/BUILD.gn#57

- we already use chromium's libc++ as of the bug you found, and on linux/arm we use our own libunwind. if we always want to use that libunwind, just changing https://chromium.googlesource.com/chromium/src/+/1c688af81fcfa4c072dcca79e698641839e8a42f/build/config/c++/BUILD.gn#23 to say `|| is_fuchsia` might be enough.
Thanks (sorry, #c0 sounds like I was incoherently drunk, but I wasn't, honest. Just generally incoherent.)

Yeah, the .stamp was a sha1 of the sysroot, so making that a define mostly made it like a version number. The related assumption is that if there was an ABI change (making a lib incompatible), there would also be a header change, so Fuchsia (internally) uses -MD to handle that. It does seem a bit odd to exclude system headers from deps unless we know it's some useful % faster, but I didn't check timings to feel strongly about that one way or the other.

libunwind didn't build when I tried that on Friday, but I haven't dug into why yet. Maybe it just needs to be rolled, or likely at least needs a Fuchsia-specific config.h.


Re: sysroot changes.

I looked at other things that use sysroot.gni for comparison. I didn't test (just looked at gn files), but I think Android, Mac, and iOS all handle this in slightly different ways (Android adds a version to some java thing, Mac has the sdk path similar to Windows, and iOS adds a version to the config (and maybe the sdk path similar to Mac?).

I don't see the Linux && use_sysroot path doing anything to handle this though.

(Aside, did we just change this on Windows by switching to clang or does clang-cl /showIncludes do the same as cl?)

Anyhoo, ignoring Linux, I think I'll just go with the Mac/Windows way since it's simplest (and we already have a .hash file sitting there from update_sdk.py).
https://chromium-review.googlesource.com/c/594270 and https://chromium-review.googlesource.com/c/594271.

Building libunwind seems fine now, I didn't go back to figure out what made this work. (It was this before for reference https://www.irccloud.com/pastebin/E1gDHH2r/)

Comment 7 by thakis@chromium.org, Jul 31 2017

> (Aside, did we just change this on Windows by switching to clang or does clang-cl /showIncludes do the same as cl?)

(clang-cl /showIncludes should do the same as cl, which iirc is "include system include paths" I believe. Yup: http://llvm-cs.pcc.me.uk/tools/clang/lib/Frontend/CompilerInstance.cpp#464)
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/buildtools/+/335548b45d17d78abbad540672d8db89dcbb1491

commit 335548b45d17d78abbad540672d8db89dcbb1491
Author: Scott Graham <scottmg@chromium.org>
Date: Mon Jul 31 16:28:29 2017

fuchsia: Build libunwind on Fuchsia too

For https://chromium-review.googlesource.com/c/594270.

Bug: 707030,  750392 
Change-Id: I438a24df6c527c6383c16095645e79284c21a9ca

[modify] https://crrev.com/335548b45d17d78abbad540672d8db89dcbb1491/third_party/libc++abi/BUILD.gn

Comment 10 by jamesr@google.com, Jul 31 2017

I think things went a bit askew here - we aren't ready to support statically linked libc++ in Fuchsia at this stage, so we'd really strongly prefer Chromium dynamically link to our standard lib.  I'll add the libc++ headers and link .so's back to the SDK.  This is important to us so we can use c++ in client libraries (which is not necessarily where we want to be long-term, but it's where we are today) and will be needed when we ship out sanitizer support as we'll be shipping different variants of the standard library to support different sanitizer combinations.
Your client libraries can link against your .so. We don't pass any C++ objects to client libraries, so us linking statically against our thing shouldn't be a problem.

re asan, we'll burn that bridge when we get there :-)

Comment 12 by jamesr@google.com, Jul 31 2017

OK - that works for now.  One thing to be careful about is leaking C++ exceptions through calls, which is somethings both sides of any client library have to be careful about, but it seems unlikely to bite us in practice.
Project Member

Comment 13 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/131568b82901daf84658a300210a9002949b54a2

commit 131568b82901daf84658a300210a9002949b54a2
Author: Scott Graham <scottmg@chromium.org>
Date: Tue Aug 01 17:20:44 2017

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: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491035}
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/DEPS
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/build/config/c++/BUILD.gn
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/build/config/fuchsia/BUILD.gn
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/build/config/sysroot.gni
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/build/fuchsia/test_runner.py
[modify] https://crrev.com/131568b82901daf84658a300210a9002949b54a2/docs/fuchsia_sdk_updates.md

Cc: thomasanderson@chromium.org
This mostly rolled; release works now.

In component debug builds though, base fails to link against _Unwind* https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.fyi%2FFuchsia__dbg_%2F5078%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout .

Previously we linked base against libunwind.so, but I believe now _Unwind* are in Chromium's libc++.so, which doesn't export those symbols after https://codereview.chromium.org/2953323002. Thomas said this was necessary to avoid conflicts with glibc symbols.

With that in mind, does https://chromium-review.googlesource.com/c/596667 seem plausible? (I wonder if there's a magic way to tryjob that against Chromium now with gerrit before landing in buildtools?)
> (I wonder if there's a magic way to tryjob that against Chromium now with gerrit before landing in buildtools?)

Ooh, I think this will work: https://chromium-review.googlesource.com/c/596668 (A thing that gerrit makes better!)
> > (I wonder if there's a magic way to tryjob that against Chromium now with gerrit before landing in buildtools?)

> Ooh, I think this will work: https://chromium-review.googlesource.com/c/596668 (A thing that gerrit makes better!)

Or not. Drat. I think the bots don't pull all branch heads so you can't refer to an uncommitted subrepo commit in src DEPS still.
Project Member

Comment 17 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/buildtools/+/275b8c481615a168464800fc925364aa1a432d37

commit 275b8c481615a168464800fc925364aa1a432d37
Author: Scott Graham <scottmg@chromium.org>
Date: Tue Aug 01 18:45:27 2017

Only disable export of libunwind symbols when libcpp is static

src tryjob at https://chromium-review.googlesource.com/c/596668.

Bug:  750392 ,  593874 
Change-Id: I3becf1ff62db61a2f0c630516bad5fffefac7d2d

[modify] https://crrev.com/275b8c481615a168464800fc925364aa1a432d37/third_party/libunwind/BUILD.gn

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/baca0c48578ca9509e5aa4bf94a1083f80106ca3

commit baca0c48578ca9509e5aa4bf94a1083f80106ca3
Author: Scott Graham <scottmg@chromium.org>
Date: Wed Aug 02 01:42:21 2017

fuchsia: roll buildtools to c950cb0

c950cb0 Only disable export of libunwind symbols when libcpp is static

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_arm

Bug:  750392 ,  593874 
Change-Id: I420202d5c83663da56654009350206784c7f6bc5
Reviewed-on: https://chromium-review.googlesource.com/596668
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491182}
[modify] https://crrev.com/baca0c48578ca9509e5aa4bf94a1083f80106ca3/DEPS

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05c7a3f218d4ff99a09fade8014ad2d529565581

commit 05c7a3f218d4ff99a09fade8014ad2d529565581
Author: Scott Graham <scottmg@chromium.org>
Date: Wed Aug 02 01:57:55 2017

fuchsia: Make test binaries depend on exe_and_shlib_deps

This resolves e.g. base_unittests not being able to find operator new,
string::string(), etc. in Debug (is_component_build=true) builds.

This matches other platforms, but was missed in creating the Fuchsia
test() template.

Bug:  750392 
Change-Id: I1a7ba2988e9d991f26d392eeab670f3a100de319
Reviewed-on: https://chromium-review.googlesource.com/596520
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491208}
[modify] https://crrev.com/05c7a3f218d4ff99a09fade8014ad2d529565581/testing/test.gni

Status: Fixed (was: Untriaged)
Until we decide differently about static-ness and/or who's libunwind we're going to use.

Sign in to add a comment