Commit graph

233 commits

Author SHA1 Message Date
Derek Xu 6f09cf9094 [VM] Add dependencies needed to generate protozero code
This adds dependencies on the perfetto, protobuf, and protobuf-gn repos on fuchsia.googlesource.com.

Change-Id: Ib196587e4cacb7e95c5ca284539fcd578d09d16b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278200
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-01-26 16:07:22 +00:00
Ryan Macnak 1aa7f17b56 [build] Default to -O2 instead of -O3.
This moderately reduces code size without large regressions on Golem. Going further to -Os still produces noticeable regressions.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38647
Change-Id: I8409908ca37d4a2b18cb989d9748e35a15072df6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217504
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-24 00:54:29 +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
Ryan Macnak ef3e0a45a8 Roll Clang from 026df9514ead to ca6196138012.
Fix new -Werror=unused-command-line-argument for -stdlib=libc++.

Change-Id: I7e6056323b7bb6da49b80299380be6ed7b70c582
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278691
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-01-10 17:20:04 +00:00
Jackson Gardner 061a9fbefb [dart2wasm] Add --enable-asserts flag.
Change-Id: I4cc9a55673374926e8b19cccf2be9888f166553d
Bug: https://github.com/dart-lang/sdk/issues/50801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276772
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-12-21 19:53:14 +00:00
Martin Kustermann 70656411b1 [vm] Avoid using -fno-exceptions globally in GN builds.
Right now `-fno-exception` will be in `cflags` for every executable.
That prevents adding & building 3rd party `DEPS` that may use
exceptions.

So we'll remove `-fno-exceptions` from global configurations and rely on
the fact that the `dart_config` GN config already has `-fno-exceptions`
in it's `cflags`.

TEST=ci

Change-Id: I8be9d7341a9c88f29cdf6dfbf32db70c7f78a9bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270403
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-11-18 09:42:48 +00:00
Joshua Litt 1ed2a07022 [dart2wasm] Build product snapshot when building for the SDK.
The `dartaotruntime` is built in `product` mode even when we do a release build. This CL wires up a product flag so we always build the Dart2Wasm product snapshot when creating the SDK.

Change-Id: Ic8c6a6da180a47a19ba818d7c449f712c9e60123
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264887
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2022-10-26 17:04:17 +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
Daco Harkes 713d226875 [misc] Generalize .gitignore for sysroots
Change-Id: I62601b0e458250da3a94764d2577d586ab8e5e1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255249
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-17 07:22:12 +00:00
Ryan Macnak 2e2d45fe05 [build] Downgrade Linux sysroots from bullseye to stretch.
Change-Id: Ic53f86cd2c96626297f6059bdf3a04f451207439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254283
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-08-10 06:23:10 +00:00
Ryan Macnak c74affb002 [build] Explicitly link against pthreads on Linux.
Some symbols appear to be here instead of libc on ARM64.

Cf. 2c5ff0bd1a.

Change-Id: I21345e8277c802db9f5652eca5e605107ea2d794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254261
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-08-09 22:30:35 +00:00
Ryan Macnak 2c5ff0bd1a [build] Update Linux sysroots from jessie to bullseye.
Change-Id: I90022916b13e61717b7e38c6ccab914ae1a5c18e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254080
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-08-08 23:05:31 +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
Anis Alibegić 40e18905f2 Fixed various typos in a lot of files
Closes https://github.com/dart-lang/sdk/pull/49478

TEST=Manual

GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-07-25 12:21:59 +00:00
Alexander Thomas 90bd16550d [infra] Upgrade checked-in SDKs to 2.18.0-271.0.dev
Tested: Builds on the CQ, built locally.
Change-Id: I25d0286d43199f4012a21e2223b1046a61a86bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251545
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-07-15 04:48:41 +00:00
Alexander Aprelev 413f60a8b6 Reland "Update clang and gn to match Fuchsia."
This reverts commit a99b0f6c09.

To fix culprit for the revert, it no longer rolls zlib, instead adds
an option to ignore clang warnings in zlib source code.

TEST=ci

Change-Id: I9a877ff0c08af961bc49fcacaad5b01f1ed0a743
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249542
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-06-22 21:54:25 +00:00
なつき 6b04565db2 Enable Large File Support extension (LFS)
This PR adds flags to enable LFS to make 32-bit builds to correctly handle 64-bit inode from the ext4/xfs file systems.

Specifically, many APIs internally uses `readdir()` for listing directory, which may crash with an `EOVERFLOW`, `Value too large for defined data type`.

See https://bugs.gentoo.org/681790#c0 for some background about this issue.

Closes https://github.com/dart-lang/sdk/pull/49179

GitOrigin-RevId: 34ff2282635ffd50cb8e5dffe57601bb0b2b18f7
Change-Id: Idd10d215f0791242fff986c18decc443609f471e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247245
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2022-06-08 19:55:22 +00:00
Alexander Thomas e89fadaf00 [build] Remove obsolete windows build files
Cq-Include-Trybots: luci.dart.try:dart-sdk-win-try,vm-kernel-msvc-windows-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try
Fixes: https://github.com/dart-lang/.allstar/issues/159
Change-Id: I0079b5d79a5d3121c6af1fc002ab062d2baf18b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245089
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
2022-05-18 13:34:36 +00:00
Ryan Macnak 3c01efcbb0 Reland "[build] Fix Android build for ARM64 Mac."
Account for simarm_x64 in TargetCpuForArch.

TEST=local
Bug: https://github.com/dart-lang/sdk/issues/48792
Change-Id: I820cb49ee8925c50196cb2472266f9e248c9089d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243642
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-05-10 16:11:53 +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 c1ef5795e1 [infra] Give VM engineers OWNERS over tools/gn.py et al.
These files frequently require changes when GN files are changed.

Change-Id: Ie0e7197ecd80081811608e05e58dfc0cf2036c03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242063
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-25 17:47:23 +00:00
Ryan Macnak 5f1bda06ee Revert "[build] Fix Android build for ARM64 Mac."
This reverts commit b50396740f.

Reason for revert: vm-kernel-precomp-linux-debug-simarm_x64

Original change's description:
> [build] Fix Android build for ARM64 Mac.
>
> TEST=local
> Bug: https://github.com/dart-lang/sdk/issues/48792
> Change-Id: Ia43dd46f90ef5f592e324bb889c20c221f69998a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241102
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=whesse@google.com,rmacnak@google.com,dacoharkes@google.com

Change-Id: I0cfdb5653dff7675afdb005df0c37f7560b26ee3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/48792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241860
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-20 23:13:29 +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 b50396740f [build] Fix Android build for ARM64 Mac.
TEST=local
Bug: https://github.com/dart-lang/sdk/issues/48792
Change-Id: Ia43dd46f90ef5f592e324bb889c20c221f69998a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-04-20 17:15:48 +00:00
なつき c50940b56b Fallback to uname for detecting ARM CPU architecture
Currently running official dart `linux/arm/v7` container image on x86_64 with QEMU results in `Unrecognized ARM CPU architecture`.

This is due to QEMU reporting host `/proc/cpuinfo` instead of the emulated architecture.

Checking `uname` in addition to `/proc/cpuinfo` would make `linux/arm/v7` build work consistently regardless of whether `--use-qemu` is supplied during SDK build time.

TEST=running the qemu bot
TEST=ran the ffi/hardfp_test.dart locally both in AOT and JIT mode.

Closes https://github.com/dart-lang/sdk/pull/48665
https://github.com/dart-lang/sdk/pull/48665

GitOrigin-RevId: d1414d747152d048f3ecaadfd0cd3356ce7a2205
Change-Id: If8b42a700d55e83fea0ee0035848308a3211ec43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238841
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-04-13 07:54:02 +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
Daco Harkes a40f7d2a42 [vm] Support -d0 on windows with clang
`python3 tools\build.py -ax64 -d0 --clang runtime`

While MSVC expects `/O0`, clang-cl expects `-d0` instead.

However, clang-cl still wants /O2.

Change-Id: I7fa2f480cc9c110c7cd9c86072b5105106fbe76a
Cq-Include-Trybots: luci.dart.try:dart-sdk-win-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236882
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-14 11:23:48 +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
Alexander Thomas 30beab0f43 [infra] Add OWNERS to the Dart SDK
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.

For additional background information see go/dart-sdk-owners.

TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
2022-02-14 14:06:34 +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 Thomas 4ff053b8b7 [infra] Support macOS SDKs > 11
Inspired by https://crrev.com/cdd96213435c7cb21042e84720d9343ca35b37cf

Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-try,vm-kernel-mac-release-x64-try,vm-kernel-mac-release-arm64-try
Change-Id: I209b279ca2066c8597170f552e9a5e98a4daf1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219790
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-11-10 13:46:34 +00:00
Tess Strickland 14bcf0f3d4 [build] Make app snapshot build failures copy/pastable.
* Use a filename without spaces for the non-existent DFE path.

* Convert a relative path to the executable to an absolute one in
  gn_run_binary so the command can be run outside the build directory
  without editing.

Change-Id: I31421acb54ad940115d4e000c4ec31605a33b5cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216800
Reviewed-by: Alexander Thomas <athom@google.com>
2021-10-14 11:51:32 +00:00
Ryan Macnak b4b7b8f116 [build] Add support for building for Fuchsia from Mac.
TEST=./tools/build.py --os=fuchsia --mode=all runtime create_sdk
Change-Id: I6b15d1cc174b84d900d526730e5f58d64d2596cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-10-13 21:14:56 +00:00
Nate Bosch f9c68a5679 Replace a bunch of references to .packages
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.

TEST=None, the change should have no visible impact.

Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-12 20:16:15 +00:00
Ryan Macnak 1d70168786 [build] Fix arm and arm64 gcc builds.
TEST=./tools/build.py --no-goma --no-clang --arch=arm,arm64 runtime
Bug: https://github.com/dart-lang/sdk/issues/47330
Change-Id: I32cea56e3ad64200a7057cc6a381bc6d9656ec7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215984
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-10-12 18:49:52 +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
Ryan Macnak 41e45e7a1c [build] Detect the host architecture of an ARM64 Mac as ARM64 even through Rosetta.
Lets AppJIT training happen directly, instead of the absurdity of arm64 (hardware) running x64 (Rosetta) running arm64 (VM's simulator).

Change-Id: Idbf82530d946099db80c550070257c4c6ead31e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214763
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-09-28 17:44:32 +00:00
Tamir Duberstein 38bc52cd0e Remove fuchsia.net.NameLookup
This protocol is replaced with fuchsia.net.name.Lookup.

Change-Id: Ib87ba5c4ca243c044d1ef43f401387bad7126b79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212100
Auto-Submit: Tamir Duberstein <tamird@google.com>
Reviewed-by: Chase Latta <chaselatta@google.com>
Commit-Queue: Chase Latta <chaselatta@google.com>
2021-09-01 17:28:07 +00:00
Zach Anderson 2cae568e38 [gn] Forward the 'pool' parameter through dart actions
Related: https://github.com/flutter/flutter/issues/86946

Change-Id: Ie33c93a76d6107760655a7769c6541222e169c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-07-26 15:20:46 +00:00
Tamir Duberstein be212c94ae Add fuchsia.net.name.Lookup
fuchsia.net.NameLookup is transitioning to fuchsia.net.name.Lookup.

@zanderso

Closes https://github.com/dart-lang/sdk/pull/46667
https://github.com/dart-lang/sdk/pull/46667

GitOrigin-RevId: a45a125ea0a96c66d5a643ee2a34c3e26287eb9a
Change-Id: Idbc44a97f42deedcf306490c391769433b3720a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207561
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Darren Chan <chandarren@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2021-07-21 02:32:19 +00:00
Ryan Macnak 1acc926edd [build] Increase linker optimization level to match Flutter and Fuchsia.
Reduces VM code size by about 15k.

Change-Id: Icaa1a5278855f88f7ce702802d6aaa62639cfac5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205120
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-06-28 18:55:11 +00:00
Tess Strickland 40a53e2a2a [build] Fix paths to clang shared libraries on Fuchsia.
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-kernel-win-release-x64-try
Change-Id: I94d65dbc239ce154db840638410d444d9f9bf50e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204584
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-06-23 10:23:05 +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