Commit graph

249 commits

Author SHA1 Message Date
Derek Xu eb5c027d26 Add the /Zc:__cplusplus option to MSVC builds
TEST=Perfetto checks the __plusplus macro and reports an error when it
thinks a version prior to C++17 is being used. Perfetto was erroneously
reporting this error during the MSVC tryjob because we weren't setting
/Zc:__cplusplus. This change fixes the issue. See
https://ci.chromium.org/ui/p/dart/builders/try/vm-kernel-msvc-windows-try/146/overview

Change-Id: I6db00bec20936c0b1743bcb6e21b2c8f829097d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-02 19:50:33 +00:00
William Hesse ec53fdd0bf Revert "[build, vm] Access TLS with less code."
This reverts commit aa79cf2708.

Reason for revert: -fPIC is needed in more places than the CL adds it to, see CI builds at https://ci.chromium.org/ui/p/dart-internal/builders/ci/dart-sdk-linux-riscv64-dev/405/overview

Original change's description:
> [build, vm] Access TLS with less code.
>
> - Avoid TLS initialization checks by using inline initialization.
> - Avoid global offset table indirection by reducing -fPIC to -fPIE.
>
> out/ReleaseXARM64/exe.stripped/dart_precompiled_runtime
> 11137992 -> 11274776 (-1.21%)
>
> We still need -fPIC in some places because we build a few shared libraries for FFI, so copy some of Fuchsia's GN setup to use -fPIE or -fPIC as appropriate.
>
> TEST=ci
> Change-Id: I6402fce3366a9c4b2741ffb4811562292b8ecb71
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285704
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

Change-Id: Idacb7869e9fa9ad0f7ed7b0caa2bae19deece7d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286144
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: William Hesse <whesse@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-01 12:19:07 +00:00
Ryan Macnak aa79cf2708 [build, vm] Access TLS with less code.
- Avoid TLS initialization checks by using inline initialization.
- Avoid global offset table indirection by reducing -fPIC to -fPIE.

out/ReleaseXARM64/exe.stripped/dart_precompiled_runtime
11137992 -> 11274776 (-1.21%)

We still need -fPIC in some places because we build a few shared libraries for FFI, so copy some of Fuchsia's GN setup to use -fPIE or -fPIC as appropriate.

TEST=ci
Change-Id: I6402fce3366a9c4b2741ffb4811562292b8ecb71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285704
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-01 01:21:55 +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
なつき ea1c4e23e5 [build] Statically link libstd++ and libgcc when using clang.
Closes https://github.com/dart-lang/sdk/pull/51400

GitOrigin-RevId: 253848462793f28071b9ef35aab08291986d01f1
Change-Id: Ideb64cb97bd7e49fe696439fb7b8e62098891668
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282961
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-14 19:25:30 +00:00
Ryan Macnak 8a95be8cda [build] Statically link libstd++ and libgcc when using gcc.
This brings the gcc build into agreement with the clang build.

It also avoids dpkg-shlibdeps picking up strange cross-dependencies when building a .deb for RISC-V.

TEST=ldd dart
Change-Id: I1dc70e6786681975a7897cefbb0db3a80ffc8ed5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-02-13 23:04:58 +00:00
Ryan Macnak 384394b4a3 Roll Fuchsia SDK to 7b3b23b2c0da59b3aceab6c49fbe7d9ed34d7382.
Avoid sharing manifests between components, which confuses `fuchsia_component`.

Change-Id: I2a035e6257284a9e8ff5da18f7c2e212e0a9091f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282120
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-02-09 22:43:36 +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
Liam Appelbe 9ad59be793 Revert "Suppress sign-compare warnings for musl libc"
This reverts commit 9fefe1054e.

Reason for revert: Breaks the riscv64 bot: https://logs.chromium.org/logs/dart-internal/buildbucket/cr-buildbucket/8790248947000585777/+/u/build_dart/stdout

Original change's description:
> Suppress sign-compare warnings for musl libc
>
> Closes https://github.com/dart-lang/sdk/pull/51225
>
> GitOrigin-RevId: 0c2d3d4b79a461d1af2127061b3857f08c22856d
> Change-Id: I9e58cccfdf65604baf0789c2a4294dfb50590e95
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280252
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

TBR=vegorov@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,copybara-worker-blackhole@google.com

Change-Id: I05c64d556b7bd6f4099f8468a94557d9a51e5260
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280480
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-02-02 20:28:46 +00:00
なつき 9fefe1054e Suppress sign-compare warnings for musl libc
Closes https://github.com/dart-lang/sdk/pull/51225

GitOrigin-RevId: 0c2d3d4b79a461d1af2127061b3857f08c22856d
Change-Id: I9e58cccfdf65604baf0789c2a4294dfb50590e95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280252
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-02 09:07:58 +00:00
Ryan Macnak 1f7ac27eec Revert "Suppress clang warning for musl libc inline"
This reverts commit ddc19f7f92.

Reason for revert: Breaks gcc build
../../runtime/bin/socket_base_posix.cc:161: error: ignoring #pragma clang diagnostic [-Werror=unknown-pragmas]
  161 |     cmsg = CMSG_NEXTHDR(&msg, cmsg);
      |
cc1plus: all warnings being treated as errors

Original change's description:
> Suppress clang warning for musl libc inline
>
> Closes https://github.com/dart-lang/sdk/pull/51191
>
> GitOrigin-RevId: d7064c43adce0b115c79e818800e44ba4f60739e
> Change-Id: Ie73e96c83294d43baf3be6772cb84705ba2d2712
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280136
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

TBR=vegorov@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com,copybara-worker-blackhole@google.com

Change-Id: I8b726d616ba1b5434b92c239c3b8897a942fad5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280300
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-01 23:25:47 +00:00
なつき ddc19f7f92 Suppress clang warning for musl libc inline
Closes https://github.com/dart-lang/sdk/pull/51191

GitOrigin-RevId: d7064c43adce0b115c79e818800e44ba4f60739e
Change-Id: Ie73e96c83294d43baf3be6772cb84705ba2d2712
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280136
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-01 21:58:18 +00:00
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