1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00
Commit Graph

95 Commits

Author SHA1 Message Date
Jonas Termansen
3f1d6a99e7 [infra] Simplify RBE configuration and allow concurrent builds.
Automatically detect the appropriate configuration file if RBE=1 is
set to request RBE on all projects, or if DART_RBE=1 is set to request
RBE for Dart only, or otherwise respect the explicit configuration file.

Automatically set the server_address location to the build directory
if it has not already been set. This is unfortunately not supported on
Windows due to the environment variable being set during build but it
needed to be set during gn.

Retain the older configuration files during the transitory period.

Bug: b/296994239
Fixes: b/320876546
Change-Id: I62d1fbfed35248477731cceda3f7267c605c4969
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355400
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-04 14:54:26 +00:00
Jonas Termansen
a19d3f3375 [infra] Support testing with RBE on Windows.
Place the windows toolchain in the build root so it can be sent to RBE.

Use relative paths in debug symbols when building with Windows clang,
which is needed for remotely building with RBE.

Set the executable bit when invoking clang-cl remotely as it has not
been set on Windows RBE clients.

Stop including .rst files during build commands as @options-from-file
is not supported by rewrapper at this time.

Forward RBE_cfg into the msvc build environment and rewrite the
INCLUDE, LIB, and LIBPATH environment variables to use relative paths
instead of absolute paths.

Don't download reclient on windows-arm64 where there is no cipd
package and the windows-arm64 python lies and says it's x64 because
they actually packaged a x64 python.

Tune the Windows -j performance to match the historic bot performance
as most casual Windows machines won't handle -j 1000 well.

Bug: b/296994239
Change-Id: I2bd1b4478fca796f0a326c062a5f478f16c2c6ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343440
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-29 10:33:09 +00:00
Alexander Aprelev
6ab194a95b [build] Update Windows SDK to 10.0.22621.0.
Sync setup_toolchain.py, vs_toolchain.py, find_depot_tools.py with chromium tot 2a6e67243533df4913d06814019b99a8b3ea385b

BUG=https://github.com/dart-lang/sdk/issues/54630

Change-Id: I42f79900951f228d8c9711fee3cab7db22f96e19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350655
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-02-08 16:06:50 +00:00
Jonas Termansen
c348fd0865 Fix RBE llvm wrapper setting the world on fire.
I don't want to set the world on fire.

Change-Id: Icef12a8398eee6cf78b8852ccba73a318c8c5563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345542
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2024-01-10 14:56:18 +00:00
Jonas Termansen
5678fd48cd [infra] Generalize RBE across operating systems.
Bug: b/296994239
Change-Id: Ie8630bcece5c2f62c5693afe654fb9d6367b33e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345286
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-01-10 11:38:43 +00:00
Jonas Termansen
2ff976e9e3 [infra] Specify Linux in RBE platform.
Bug: b/296994239
Change-Id: Ice6ed1bda597e300600d6d6823901ec21f5cfcd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342420
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-12-19 10:23:52 +00:00
Jonas Termansen
750050ec40 [infra] Enable RBE on Android.
The sysroot needs to be passed as a relative path inside the exec root
since RBE will fail to compile with an absolute path.

Bug: b/296994239
Change-Id: Idc0e155368daaf904ac4650bd8668b8955d09e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338002
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-11-24 14:02:27 +00:00
Jonas Termansen
6a08407c6f [infra] Bump reclient and don't RBE on gcc.
This is a no-op since RBE is not enabled anywhere yet.

Bug: b/296994239
Change-Id: I2d39419736fca0382a6082f6be64e787348bb825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336440
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-11-15 16:47:49 +00:00
Vyacheslav Egorov
4ce23629eb [gn] Support producing signed builds on Mac
This can be controlled via  codesigning_identity GN arg.

For example, setting codesigning_identity="-"
would produce ad-hoc signed binaries.

This CL also includes changes in vm/cc tests which are needed
for tests to be green when running with hardened runtime.

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

Tested: enabled ad-hoc signing and tested on bots.
Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-mac-debug-x64-try
Change-Id: I3c3a6265c62b2904e43a326b7d8223bcfd393577
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333401
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-11-03 07:36:25 +00:00
Ryan Macnak
aac74693f5 [build] Avoid GN warning about use_rbe being set but never declared.
Change-Id: Id4ae1a6edf1a757eac3916079345cf3926f71b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332164
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-25 21:15:05 +00:00
Jonas Termansen
f4f557345c [infra] Reland "Begin RBE Linux x64 support."
Bug: b/296994239
Change-Id: I179cc7729846885ee952d26082a1e615a46a30b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331923
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-24 14:36:19 +00:00
Alexander Thomas
d37620ed03 Revert "[infra] Begin RBE Linux x64 support."
This reverts commit 9a11fe517c.

Reason for revert: broke the build for some users.

Original change's description:
> [infra] Begin RBE Linux x64 support.
>
> Bug: b/296994239
> Change-Id: I0ddf9a1beb2996ac67b59779b8b8113432434786
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331282
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: Jonas Termansen <sortie@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: b/296994239
Change-Id: Id70259b9357790581f11f105516ff0c6c63ab1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331780
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-10-23 16:45:47 +00:00
Jonas Termansen
9a11fe517c [infra] Begin RBE Linux x64 support.
Bug: b/296994239
Change-Id: I0ddf9a1beb2996ac67b59779b8b8113432434786
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331282
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-23 14:42:59 +00:00
Ryan Macnak
99bb8aa4a5 [build, test_runner] Update to NDK 27.
Notably, this carries us across the gcc->llvm transition.

Change-Id: I46203749c64c7ef0f52de40abcd4a073517cb06f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330949
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-10-18 22:38:23 +00:00
Ryan Macnak
90d488b98e [build] Android RISCV64 using a Canary NDK.
Change-Id: I447941fd4eee0c1e4394b3ab5c0b9c36a7b4c257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330701
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-10-17 16:34:27 +00:00
Ryan Macnak
b8ee3a9996 [build] Don't export all symbols to the dynamic table.
We were exporting all symbols to the dynamic table so that they could be looked up using `dladdr` for the profiler and backtracer. The symbols include our statically-linked libcxx, which can create trouble when another DSO has a different version of libcxx. Now we export only the VM embedding API functions (`Dart_*`) and use a specially produced table to do the symbolization.

TEST=runtime/tests/vm/dart/exported_symbols_test.dart
TEST=runtime/tests/vm/dart/symbolized_crash_test.dart
Bug: https://github.com/dart-lang/sdk/issues/53267
Change-Id: I2ee494fba86f67127ba0f6f402622f01a4662207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323702
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-09-05 21:47:59 +00:00
Ryan Macnak
60441151ce [build] Consistently use either gcc/binutils or clang/llvm.
Change-Id: I855c06f7af1d602d5e83cf547b9f18092062ac83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304541
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-05-22 15:57:18 +00:00
Ryan Macnak
3c06a5aa17 [build] Update Android SDK to match Flutter.
TEST=ci
Change-Id: Ic86332a60fe570d0e79272869284a69ea109edef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-05-16 16:32:58 +00:00
Ryan Macnak
4b5d2087a8 [build] Honor build.py --toolchain for ia32 and x64 like the other architectures.
TEST=local build with custom toolchain
Change-Id: I7b9563da54afae0b3057d596d80a778c8db523a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294428
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-12 02:27:38 +00:00
Ryan Macnak
2cc96bfa0b [vm] Add an ABI for Fuchsia RISC-V.
https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0211_fuchsia_on_risc-v

TEST=./tools/build.py -mrelease -asimriscv64 gen_snapshot_fuchsia gen_snapshot_product_fuchsia
CoreLibraryReviewExempt: VM-only
Change-Id: Ie62addda6c15a5b44e814c49b543319aef4fc5e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281869
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-20 20:46:27 +00:00
Jackson Gardner
b890ed4cc3 Reland x3 [dart2wasm] Include wasm-opt in the shipped dart-sdk.
Hide this behind a flag, so that we can disable it when building in the flutter in-tree build.

The flag will be set to false for the in-tree flutter build, see
https://github.com/flutter/engine/pull/40195

Change-Id: I248376985d05bfb248a2eab6fa377cbb01d75654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288040
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-10 18:34:10 +00:00
Jackson Gardner
e3661b7d2f Revert "Reland "Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk."""
This reverts commit faecf41be1.

Reason for revert: Flutter HHH bots are broken: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8788949281966049297/+/u/build_host_debug/stdout

Original change's description:
> Reland "Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk.""
>
> This is a reland of commit b19091385a
>
> Fixed the calculation of the paths of binaryen source files so that they
> work properly when building as a dependency (inside the flutter engine
> repo).
>
> Original change's description:
> > Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk."
> >
> > This is a reland of commit 6271d26baf
> >
> > The change broke the gcc riscv64 builders, due to a `unused-variable`
> > warning coming from binaryen sources. That warning has now been
> > disabled for binaryen targets.
> >
> > Original change's description:
> > > [dart2wasm] Include wasm-opt in the shipped dart-sdk.
> > >
> > > Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
> > > Reviewed-by: Martin Kustermann <kustermann@google.com>
> > > Commit-Queue: Jackson Gardner <jacksongardner@google.com>
> > > Reviewed-by: Aske Simon Christensen <askesc@google.com>
> >
> > Change-Id: I76bf4ad5d1f6a8116631df4b91cbc5a52cac4f31
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283240
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
> > Commit-Queue: Jackson Gardner <jacksongardner@google.com>
>
> Change-Id: I5cc269daebc5e2068c084bb72b2bd7cb58ba6fbe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283721
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Jackson Gardner <jacksongardner@google.com>

TBR=kustermann@google.com,askesc@google.com,joshualitt@google.com,jacksongardner@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: If4e864b3dfb5d9ff840846bff0690247256b2762
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283745
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-17 09:04:50 +00:00
Jackson Gardner
faecf41be1 Reland "Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk.""
This is a reland of commit b19091385a

Fixed the calculation of the paths of binaryen source files so that they
work properly when building as a dependency (inside the flutter engine
repo).

Original change's description:
> Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk."
>
> This is a reland of commit 6271d26baf
>
> The change broke the gcc riscv64 builders, due to a `unused-variable`
> warning coming from binaryen sources. That warning has now been
> disabled for binaryen targets.
>
> Original change's description:
> > [dart2wasm] Include wasm-opt in the shipped dart-sdk.
> >
> > Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
> > Commit-Queue: Jackson Gardner <jacksongardner@google.com>
> > Reviewed-by: Aske Simon Christensen <askesc@google.com>
>
> Change-Id: I76bf4ad5d1f6a8116631df4b91cbc5a52cac4f31
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283240
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Jackson Gardner <jacksongardner@google.com>

Change-Id: I5cc269daebc5e2068c084bb72b2bd7cb58ba6fbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2023-02-16 22:10:18 +00:00
Daco Harkes
97d085c84b Revert "Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk.""
This reverts commit b19091385a.

Reason for revert: This breaks the Flutter build.
'../../third_party/dart/third_party/dart/third_party/binaryen/src/src/ir/memory-utils.cpp', needed by 'obj/third_party/dart/third_party/dart/third_party/binaryen/src/src/ir/binaryen_sources.memory-utils.o', missing and no known rule to make it

Original change's description:
> Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk."
>
> This is a reland of commit 6271d26baf
>
> The change broke the gcc riscv64 builders, due to a `unused-variable`
> warning coming from binaryen sources. That warning has now been
> disabled for binaryen targets.
>
> Original change's description:
> > [dart2wasm] Include wasm-opt in the shipped dart-sdk.
> >
> > Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
> > Commit-Queue: Jackson Gardner <jacksongardner@google.com>
> > Reviewed-by: Aske Simon Christensen <askesc@google.com>
>
> Change-Id: I76bf4ad5d1f6a8116631df4b91cbc5a52cac4f31
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283240
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Jackson Gardner <jacksongardner@google.com>

TBR=kustermann@google.com,askesc@google.com,joshualitt@google.com,jacksongardner@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Iee8e909d701d22abac00d199dee7591bf9bf5f7a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283560
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-16 09:07:35 +00:00
Jackson Gardner
b19091385a Reland "[dart2wasm] Include wasm-opt in the shipped dart-sdk."
This is a reland of commit 6271d26baf

The change broke the gcc riscv64 builders, due to a `unused-variable`
warning coming from binaryen sources. That warning has now been
disabled for binaryen targets.

Original change's description:
> [dart2wasm] Include wasm-opt in the shipped dart-sdk.
>
> Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

Change-Id: I76bf4ad5d1f6a8116631df4b91cbc5a52cac4f31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283240
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
2023-02-15 19:09:07 +00:00
William Hesse
a9fe60b1f9 Revert "[dart2wasm] Include wasm-opt in the shipped dart-sdk."
This reverts commit 6271d26baf.

Reason for revert: The build is broken on linux-riscv64 with this change.

Original change's description:
> [dart2wasm] Include wasm-opt in the shipped dart-sdk.
>
> Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

TBR=kustermann@google.com,askesc@google.com,joshualitt@google.com,jacksongardner@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I520d9be6d43b55551694a58a22c0ae8ae3e7344f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281802
Commit-Queue: William Hesse <whesse@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-02-08 19:24:46 +00:00
Jackson Gardner
6271d26baf [dart2wasm] Include wasm-opt in the shipped dart-sdk.
Change-Id: Ib224f0b92fa28019ad3cf67d7ba2bef5c31b92ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280840
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-08 18:51:48 +00:00
Josh Soref
ba15a61271 Spelling build
Closes https://github.com/dart-lang/sdk/pull/50859

GitOrigin-RevId: 7b056018c2925745701bdecdd7da325d9458204d
Change-Id: Iff037d773713bf73efde6951599becfd7297b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277740
Reviewed-by: Alexander Thomas <athom@google.com>
2023-01-23 08:56:14 +00:00
なつき
afe9219026 [infra] Support for Alpine Linux Sysroot
Closes https://github.com/dart-lang/sdk/pull/51044

TEST=manually tested by the contributor

GitOrigin-RevId: 86c85da0680047e08caf81cc4c12098ae85c0d2b
Change-Id: I591d7e17ce3a87cf8ce8380c9511f70d738d44c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279267
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-01-19 10:36:51 +00:00
Tess Strickland
9df6656aa9 [build] Re-add linker flags to create empty section in AOT runtime.
To avoid these flags being applied to unexpected build rules, we
separate them out into a separate config that is then pulled in
explicitly in the `dart_precompiled_runtime{,_product}` executable
rules. Only those two executables need the additional empty section:
the product version because it becomes `dartaotruntime` in the SDK
bundle, and the non-product version because some of our tests build
standalone executables using it.

The linker flags were originally removed due to
https://github.com/flutter/flutter/issues/112687.
With the recent removal of bitcode support from Flutter (see
https://github.com/flutter/flutter/issues/107883), I can build
the `ios_release` target locally without any issue.

This also reverts the clang DEPS changes from CL 256208 (again).

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/dart-lang/sdk/issues/49783
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Change-Id: Ie46402ec2eeda23109247eb9d7a64935ec2052cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262429
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-10-07 09:26:18 +00:00
Tess Strickland
fef905cbe2 [build] Remove linker flags to create empty section in AOT runtime.
These linker flags are causing issues with the Dart->Flutter roll,
and so I'm removing them for now until we can figure out how to
reintroduce them later.

To avoid overwriting section contents, even at a much reduced
amount, I also reland the clang DEPS revert in CL 256208.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/flutter/flutter/issues/112687
Change-Id: I35d3ff6a2a0a46e2f589469fb47bca5f9ca6df1d
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262161
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-30 12:48:59 +00:00
Tess Strickland
b0c4ddf919 [pkg/dart2native] Avoid overwriting section contents in MachO files.
To create a Dart standalone executable on MacOS, we modify the
dartaotruntime executable to add the snapshot contents, and the
VM looks into the executable on disk to find the snapshot to load.

Previously, we did this by adding a new 64-bit segment load command
with a single section, where the section's file offset and size
describes the inserted snapshot. This meant the Mach-O header size increased by 152 bytes.

Originally, this wasn't an issue as there was plenty of padding, but
later clang updates removed most of this padding, and so writing the
new header actually overwrote the initial contents of the first section
in the file, which happens to be the __text section. In addition, since
the first section's offset was now declared to be within the header,
utilities that strictly validated the Mach-O format, like codesign,
would report errors.

This CL changes it so that we actually reserve space in the
dartaotruntime header using the -add_empty_section flag to the linker.
In addition, we change from using a segment load command to using a
(40 byte) note load command. This is because a segment load command
specifies that the contents should be loaded in memory, but we don't
use that loaded version. Instead, the VM reloads it from the executable
on disk so it can appropriately mmap the different parts of the
snapshot. A note section instead just declares a section of the
executable as arbitrary data that the owner can read from the file
and use as desired, which is semantically closer to our current usage.

This CL also adds a test to pkg/dartdev/test/commands/compile_test to
ensure that corrupting a random part of the snapshot in the executable
causes signature verification to fail.

This CL also reverts CL 256208, thus relanding the clang changes
starting from June that originally raised awareness of the issue by
greatly reduced the amount of padding after the load commands.

TEST=pkg/dartdev/test/commands/compile_test

Bug: https://github.com/dart-lang/sdk/issues/49783
Change-Id: Iee554d87b0eabaecd7a534ca4e4facfefbce6385
Cq-Include-Trybots: luci.dart.try:analyzer-mac-release-try,dart-sdk-mac-arm64-try,dart-sdk-mac-try,pkg-mac-release-arm64-try,pkg-mac-release-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260108
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2022-09-29 08:32:47 +00:00
Alexander Thomas
e87f2d895c [build] Switch builds to the ninja in DEPS
Note: this "upgrades" ninja to 1.11.1.

Change-Id: Idca0f8a2a67cf5d5dbe75661bb14de174012580f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261101
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-09-27 11:24:03 +00:00
Martin Kustermann
f73f25edab Revert to clang toolchain that was rolled in March
This reverts commit fef426ac0b
  This reverts commit e9f629f607
  This reverts commit 413f60a8b6

Reason for revert: With newer clang toolchain for MachOS, the produced
MachO binaries (e.g. `dartaotruntime`) can no longer be signed with
`codesign` on older MacOS versions (before MacOS 12).

We will report this breaking change to fuchsia-clang team and revert
to older (working) clang in the meantime to unblock releases.

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

Tested: ci
Co-authored-by: Martin Kustermann <kustermann@google.com>
Change-Id: I0d4fa6617df2908c4af31e102f5faf9e3ea1df95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256208
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-08-24 16:56:19 +00:00
Ryan Macnak
fef426ac0b Update clang and gn to match Fuchsia.
Begin using mac-arm64 toolchain instead of mac-x64 under Rosetta for non-Goma builds.

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=73385
Change-Id: I40f311dea1845b9abe11f28832582104cf43a4bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252867
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-08-19 06:21:44 +00:00
Alexander Aprelev
a6f56aec88 [infra] Update windows build and toolchain setup python scripts.
The scripts originate from Chromium, this CL syncs Dart's copy with Chromium tip of the tree at 6f8f710079b3e363f4fd7ffe3d848384e4b7c816.

Format toolchain/win/BUILD.gn

Change-Id: Ice7ba48bdd102ffe0e25c6ae6068f83cb14169ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253500
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-08-03 16:30:56 +00:00
Clement Skau
81f6cc144e [infra] Error, don't crash setup_toolchain.py
In case the environment is incorrectly set on Windows (e.g.
GYP_MSVS_OVERRIDE_PATH pointing to a non-existing path), the
setup_toolchain.py script may raise an exception.

The script attempts to run a subprocess to gather the environment
variables. But it does not check that the process actually
succeeded.
In case the process fails the environment data will be invalid and
the script will ultimately raise an exception.

This change adds a check for the process failing, and gracefully
warns and exits the script instead.

TEST=Manual build on Windows.
Change-Id: I3624bdf98e0ebe48b403825a90ce2e86c2ed8008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242860
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-05-02 13:53:00 +00:00
Ryan Macnak
8778e322cc [build] Toolchain setup for ARM64 Windows.
Bug: https://github.com/dart-lang/sdk/issues/47824
Change-Id: I75fa3be1ea66d7f9c5fbafc8cd05640324531cc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239542
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-20 17:21:58 +00:00
Ryan Macnak
50c5b075ec [build] Fix building on an ARM64 Linux host.
Change-Id: I42a8265722083fb02f815c635c44f63f809a9082
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237923
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-03-22 00:50:18 +00:00
Alexander Thomas
b5fb9c7bca [infra] Fix OWNERS files
* Remove leftover files from chromium.
* Fix syntax errors in some files.

Bug: b/216440912
Change-Id: Ibe9dc23b88d0def993bd1217df6089c1112b4ad9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235082
Reviewed-by: William Hesse <whesse@google.com>
2022-03-03 09:56:33 +00:00
Ryan Macnak
04ba20aa98 [vm] Support RISC-V.
Implements a backend targeting RV32GC and RV64GC, based on Linux standardizing around GC. The assembler is written to make it easy to disable usage of C, but because the sizes of some instruction sequences are compile-time constants, an additional build configuration would need to be defined to make use of it.

The assembler and disassembler cover every RV32/64GC instruction. The simulator covers all instructions except accessing CSRs and the floating point state accessible through such, include accrued exceptions and dynamic rounding mode.

Quirks:
  - RISC-V is a compare-and-branch architecture, but some existing "architecture-independent" parts of the Dart compiler assume a condition code architecture. To avoid rewriting these parts, we use a peephole in the assembler to map to compare-and-branch. See Assembler::BranchIf. Luckily nothing depended on taking multiple branches on the same condition code set.
  - There are no hardware overflow checks, so we must use Hacker's Delight style software checks. Often these are very cheap: if the sign of one operand is known, a single branch is needed.
  - The ranges of RISC-V branches and jumps are such that we use 3 levels of generation for forward branches, instead of the 2 levels of near and far branches used on ARM[64]. Nearly all code is handled by the first two levels with 20-bits of range, with enormous regex matchers triggering the third level that uses aupic+jalr to get 32-bits of range.
  - For PC-relative calls in AOT, we always generate auipc+jalr pairs with 32-bits of range, so we never generate trampolines.
  - Only a subset of registers are available in some compressed instructions, so we assign the most popular uses to these registers. In particular, THR, TMP[2], CODE and PP. This has the effect of assigning CODE and PP to volatile registers in the C calling convention, whereas they are assigned preserved registers on the other architectures. As on ARM64, PP is untagged; this is so short indices can be accessed with a compressed instruction.
  - There are no push or pop instructions, so combining pushes and pops is preferred so we can update SP once.
  - The C calling convention has a strongly aligned stack, but unlike on ARM64 we don't need to use an alternate stack pointer. The author ensured language was added to the RISC-V psABI making the OS responsible for realigning the stack pointer for signal handlers, allowing Dart to leave the stack pointer misaligned from the C calling convention's point of view until a foreign call.
  - We don't bother with the link register tracking done on ARM[64]. Instead we make use of an alternate link register to avoid inline spilling in the write barrier.

Unimplemented:
 - non-trivial FFI cases
 - Compressed pointers - No intention to implement.
 - Unboxed SIMD - We might make use of the V extension registers when the V extension is ratified.
 - BigInt intrinsics

TEST=existing tests for IL level, new tests for assembler/disassembler/simulator
Bug: https://github.com/dart-lang/sdk/issues/38587
Bug: https://github.com/dart-lang/sdk/issues/48164
Change-Id: I991d1df4be5bf55efec5371b767b332d37dfa3e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217289
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-01-20 00:57:57 +00:00
Alexander Aprelev
7c5b019fdf [build] Fix zero-build of few common targets on Windows.
Fixes https://github.com/dart-lang/sdk/issues/47392

TEST=zero-build on windows

Change-Id: I2b37b48b7acc8c5139e989159250c361317e4ea5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215940
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-10-07 16:23:42 +00:00
Tess Strickland
3c7075baca Reland "[build] Use Fuchsia windows clang toolchain"
This reverts commit fc9383ed41.

Reason for revert: After discussion with athom, the breakage is a known temporary situation.

Original change's description:
> Revert "[build] Use Fuchsia windows clang toolchain"
>
> This reverts commit e479049467.
>
> Reason for revert: Broke build on vm-fuchsia-release-x64.
>
> Original change's description:
> > [build] Use Fuchsia windows clang toolchain
> >
> > Change-Id: Ie04039c736f40174cc45a61aa637a88fa53d9024
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201862
> > Reviewed-by: Alexander Thomas <athom@google.com>
>
> TBR=aam@google.com,athom@google.com
>
> Change-Id: I3f1ce2c30bf0600b025bc95a051e569660e140c0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204582
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: I0efe29d2dc11a2f3e65d65d2f2eaecc4c827490a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204583
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-06-23 08:50:47 +00:00
Tess Strickland
fc9383ed41 Revert "[build] Use Fuchsia windows clang toolchain"
This reverts commit e479049467.

Reason for revert: Broke build on vm-fuchsia-release-x64.

Original change's description:
> [build] Use Fuchsia windows clang toolchain
>
> Change-Id: Ie04039c736f40174cc45a61aa637a88fa53d9024
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201862
> Reviewed-by: Alexander Thomas <athom@google.com>

TBR=aam@google.com,athom@google.com

Change-Id: I3f1ce2c30bf0600b025bc95a051e569660e140c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204582
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-06-23 08:45:04 +00:00
Alexander Aprelev
e479049467 [build] Use Fuchsia windows clang toolchain
Change-Id: Ie04039c736f40174cc45a61aa637a88fa53d9024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201862
Reviewed-by: Alexander Thomas <athom@google.com>
2021-06-23 07:33:56 +00:00
Clement Skau
67f097a161 [tools] Update all iteritems -> items
This migrates old python2 dict.iteritems() to python3 dict.items().
iteritems was removed in python3 meaning these script will otherwise not
run.
Note that this remains backwards compatible since dict.items() also
existed in python2, though the implementation was more memory intensive
for large dicts (which these likely aren't).

This is similar to https://dart-review.googlesource.com/c/sdk/+/200184

Change-Id: I4fe5c90d21de97d0ecceb27fa6efa7d7deb14098
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200864
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-05-20 11:36:52 +00:00
Alexander Thomas
b5c63ce757 [infra] Migrate scripts to python3
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.

Fixes: https://github.com/dart-lang/sdk/issues/28793

TEST=Manually tested common user journeys.

Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-15 10:10:20 +00:00
Ryan Macnak
e30e0cd410 [build] Setup cross-build for ARM64 Mac; still doesn't link.
Bug: https://github.com/dart-lang/sdk/issues/42773
Change-Id: I7f5715952461ea87310dacb8aa37c66692b1aacc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-02-09 23:59:18 +00:00
Vyacheslav Egorov
5548d11f4c Revert "[vm/build] Workaround for ld 2.19 crash on ARM"
This reverts commit e961aa565e.

Reason for revert: does not actually work

Original change's description:
> [vm/build] Workaround for ld 2.19 crash on ARM
>
> When producing ARM builds instruct llvm-objcopy to drop .ARM.exidx/extab
> sections. These sections don't contain any useful information (we don't use
> exceptions or unwind C++ frames and most of the dart binary is in fact not
> covered by them), however they have been seen to break dynamic linker in older
> glibc versions (pre 2.23) because .ARM.exidx ends up being positioned between
> .rel.dyn and .rel.plt sections while older versions of dynamic linker
> expect these two sections to appear one after another in the ELF file.
>
> Closes https://github.com/dart-lang/sdk/issues/41644.
>
> Change-Id: I0ceebb63105591f132f3764180ae041366cbcade
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175723
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com,rmacnak@google.com,alexmarkov@google.com

Change-Id: Ia797d8bb6e5dbc44bf68965320da1e03ece17052
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175727
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-12-11 21:49:11 +00:00
Vyacheslav Egorov
e961aa565e [vm/build] Workaround for ld 2.19 crash on ARM
When producing ARM builds instruct llvm-objcopy to drop .ARM.exidx/extab
sections. These sections don't contain any useful information (we don't use
exceptions or unwind C++ frames and most of the dart binary is in fact not
covered by them), however they have been seen to break dynamic linker in older
glibc versions (pre 2.23) because .ARM.exidx ends up being positioned between
.rel.dyn and .rel.plt sections while older versions of dynamic linker
expect these two sections to appear one after another in the ELF file.

Closes https://github.com/dart-lang/sdk/issues/41644.

Change-Id: I0ceebb63105591f132f3764180ae041366cbcade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175723
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2020-12-11 08:48:38 +00:00