Commit graph

30 commits

Author SHA1 Message Date
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 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 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
なつき 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 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
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
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
Zach Anderson 6810d4604b [infra] Roll toolchain.
related #32364, #32363, #32362

Change-Id: Ia8ac3af0317fc67efb2a38e506b2924780473b8f
Reviewed-on: https://dart-review.googlesource.com/44400
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-03-01 20:09:29 +00:00
Zachary Anderson 379a1cf24a [infra] Roll clang toolchain forward
Change-Id: Id9c98520f47ce9660efd271bc81062b93fdc035f
Reviewed-on: https://dart-review.googlesource.com/33981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-01-10 21:23:39 +00:00
Zach Anderson 897c6257cd Revert "[infra] Roll clang toolchain forward"
This reverts commit 8ee7a97651.

Reason for revert: lld optimization level -Wl,-O1 appears to either
have a regression or to confuse Golem binary comparison tool.

Original change's description:
> [infra] Roll clang toolchain forward
>
> Change-Id: I41afe48f2fdc056436b58dc8158c62e9207cc43f
> Reviewed-on: https://dart-review.googlesource.com/32140
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TBR=whesse@google.com,rmacnak@google.com,zra@google.com,athom@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I36ec03150a22f89c4cb5371dd1bf43df8a6f16f6
Reviewed-on: https://dart-review.googlesource.com/32800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-01-06 08:27:09 +00:00
Zachary Anderson 8ee7a97651 [infra] Roll clang toolchain forward
Change-Id: I41afe48f2fdc056436b58dc8158c62e9207cc43f
Reviewed-on: https://dart-review.googlesource.com/32140
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2018-01-03 23:37:15 +00:00
Zachary Anderson d9eb629ffa [infra] Use Clang for ia32 and arm64. Use the dl'd sysroots by default.
This CL switches the ia32 and arm64 builds to use clang by default.
The arm build can't be switched at least until we roll clang to
pick up the fix for https://reviews.llvm.org/D34691.

This CL also changes to use the sysroots from wheezy (and jessie
for arm64) by default so that we can be building/testing locally with
the same setup as we are shipping in the SDK.

Change-Id: I09a1907ee7f78c3f4bb8d56ffdbbd6107ed054d9
Reviewed-on: https://dart-review.googlesource.com/25160
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-12-02 06:19:33 +00:00
Zachary Anderson e94ff71e64 [infra] Roll back toolchain due to crasher on mac.
related #30642

Change-Id: Id1777132d4447da45eec07513406b25e9c1795b0
Reviewed-on: https://dart-review.googlesource.com/4061
Reviewed-by: William Hesse <whesse@google.com>
2017-09-07 16:14:40 +00:00
Zachary Anderson d1b542f8cd Reland: [infra] Roll clang toolchain forward
Build spuriously worked after initial roll due to stale files hanging
around longer than they should have. This CL relands and updates
(hopefully) all the necessary paths.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3010023002 .
2017-09-01 11:15:40 -07:00
Zachary Anderson ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -07:00
Zachary Anderson 34f601a8db Fix ARMv6 Linux cross-build
related #29676

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2892413002 .
2017-05-22 13:15:33 -07:00
Zachary Anderson 81e428fd39 [infra] Assembles the SDK using GN rather than create_sdk.py
This has a few advantages:
- We can track dependencies more precisely
- ninja can assemble things in parallel as they're ready rather than
  sequentially all at once.
- It is easier to customize SDKs depending on target platform, e.g.
  Fuchsia.

This CL also has a number of cleanups:
- Defining is_fuchsia and is_fuchsia host so we don't always have to check
- Piping through toolchain overrides in more places
- Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows

related #29558

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2848943003 .
2017-05-20 23:30:09 -07:00
Zach Anderson 726732dd6b [infra] Roll clang to match the version used by Flutter
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.

The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.

This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.

As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.

This change is a prerequisite for assembling the SDK in GN
rather than with a python script:

https://codereview.chromium.org/2848943003/

and will be nicer for making prebuilt SDKs for Fuchsia.

Resubmitting this with the following fixes:
1. Rolls further forward to get past a GN bug
2. Fixes the Android build.
3. Style cleanups in gn.py

Review-Url: https://codereview.chromium.org/2858873005 .
2017-05-06 21:45:00 -07:00
Zachary Anderson ab422ad194 Revert "[infra] Roll clang to match the version used by Flutter"
This reverts commit 6bf2c800fd.

There is still some strangeness with the new GN binary not wanting
to do an incremental build on top of a build that used an old GN
binary.

Review-Url: https://codereview.chromium.org/2861903002 .
2017-05-03 15:56:21 -07:00
Zachary Anderson 6bf2c800fd Reland: [infra] Roll clang to match the version used by Flutter
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.

The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.

This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.

As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.

This change is a prerequisite for assembling the SDK in GN
rather than with a python script:

https://codereview.chromium.org/2848943003/

and will be nicer for making prebuilt SDKs for Fuchsia.

Review-Url: https://codereview.chromium.org/2855283002 .
2017-05-03 15:42:46 -07:00
Zachary Anderson 958c25c1db Revert "[infra] Roll clang to match the version used by Flutter"
This reverts commit cc968ca45b.

This CL will have to be relanded in two pieces so that the
update to tools/gn.py lands before the unmodified version
can invoke the updated GN binary.

Review-Url: https://codereview.chromium.org/2855973006 .
2017-05-03 15:16:21 -07:00
Zachary Anderson cc968ca45b [infra] Roll clang to match the version used by Flutter
Flutter uses the same clang toolchain as Fuchsia. This CL puts Dart
on that toolchain, as well. This roll should entail no changes to
glibc version requirements on Linux.

The Fuchsia buildtools distribute clang-format with the toolchain
rather than separately, so this CL introduces forwarding scripts
that are copied to the right place under //buildtools.

This CL sets the default for the number of workers in //tools/gn.py
to 1, as the newer GN version fails occasionally when run
concurrently with other invocations.

As Flutter does, this CL uses the clang toolchain to build for
Android. Thus, it is now possible to build for Android on MacOS.

This change is a prerequisite for assembling the SDK in GN
rather than with a python script:

https://codereview.chromium.org/2848943003/

and will be nicer for making prebuilt SDKs for Fuchsia.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2854583002 .
2017-05-03 14:50:59 -07:00
Zachary Anderson f1c7a22c43 [infra] Fixes for cross-toolchains
toolchain_prefix was not correctly propagated everywhere it needed to
go. This CL also adds an error to build.py if someone tries to use
--toolchain as it is not supported there.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2797303005 .
2017-04-06 15:03:26 -07:00
Zachary Anderson c4e1b1c641 GN: Don't strip binary with clang on x64
Review URL: https://codereview.chromium.org/2494563002 .
2016-11-09 15:00:44 -08:00
Zachary Anderson 1ed9dc3ac0 GN: Fix arm cross build to match gyp build
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2456463003 .
2016-10-26 07:58:42 -07:00
Zachary Anderson 7e1b7e54d7 Starting work on full GN build
This change:
- Sucks in gn binaries
- Sucks in a version of llvm that the GN build likes
- Adds tools/gn.py to invoke gn
- Adds a root BUILD.gn and .gn file
- Removes chrome boilerplate we don't need
- etc.

This lets us do a standalone build of the 'runtime'
target for x64, ia32, arm, arm64, mips, and the
simulators on Linux, and arm and arm64 on Android.

It does not include tcmalloc, and hasn't been tested
on Mac or Windows. That work and more cleanup of
chrome boilerplate will come in follow-up CLs.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2350583002 .
2016-09-23 07:47:36 -07:00
John McCutchan 36af9946c5 Add a snapshot of flutter/engine/src/build to our sdk
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2101243005 .
2016-07-01 11:09:28 -07:00