[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>
This commit is contained in:
Tess Strickland 2022-09-30 12:48:59 +00:00 committed by Commit Queue
parent 21d2935dad
commit fef905cbe2
6 changed files with 29 additions and 51 deletions

17
DEPS
View file

@ -66,8 +66,8 @@ vars = {
# The list of revisions for these tools comes from Fuchsia, here:
# https://fuchsia.googlesource.com/integration/+/HEAD/toolchain
# If there are problems with the toolchain, contact fuchsia-toolchain@.
"clang_revision": "60d276923902051192eba692e5312e605c9d9f65",
"gn_revision": "0bcd37bd2b83f1a9ee17088037ebdfe6eab6d31a",
"clang_revision": "c2592c374e469f343ecea82d6728609650924259",
"gn_revision": "d7c2209cebcfe37f46dba7be4e1a7000ffc342fb",
# Ninja, runs the build based on files generated by GN.
"ninja_tag": "version:2@1.11.1.chromium.4",
@ -466,7 +466,8 @@ deps = {
"version": "git_revision:" + Var("clang_revision"),
},
],
"condition": "host_os == mac", # On ARM64 Macs too because Goma doesn't support the host-arm64 toolchain.
# TODO(https://fxbug.dev/73385): Use arm64 toolchain on arm64 when it exists.
"condition": "host_cpu == x64 and host_os == mac or host_cpu == arm64 and host_os == mac",
"dep_type": "cipd",
},
Var("dart_root") + "/buildtools/win-x64/clang": {
@ -489,16 +490,6 @@ deps = {
"condition": "host_os == 'linux' and host_cpu == 'arm64'",
"dep_type": "cipd",
},
Var("dart_root") + "/buildtools/mac-arm64/clang": {
"packages": [
{
"package": "fuchsia/third_party/clang/mac-arm64",
"version": "git_revision:" + Var("clang_revision"),
},
],
"condition": "host_os == 'mac' and host_cpu == 'arm64'",
"dep_type": "cipd",
},
Var("dart_root") + "/third_party/webdriver/chrome": {
"packages": [

View file

@ -2,11 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../toolchain/goma.gni")
_toolchain_cpu = host_cpu
if (host_os == "mac" && use_goma) {
# Goma does not support ARM64.
if (host_os == "mac") {
# TODO(https://fxbug.dev/73385): Use arm64 toolchain on arm64 when it exists.
_toolchain_cpu = "x64"
}

View file

@ -377,10 +377,7 @@ config("compiler") {
} else if (is_linux) {
toolchain_stamp_file =
"//buildtools/linux-x64/clang/.versions/clang.cipd_version"
} else if (is_mac && host_cpu == "arm64") {
toolchain_stamp_file =
"//buildtools/mac-arm64/clang/.versions/clang.cipd_version"
} else if (is_mac) {
} else {
toolchain_stamp_file =
"//buildtools/mac-x64/clang/.versions/clang.cipd_version"
}
@ -551,7 +548,6 @@ if (is_win) {
"-Wno-microsoft-unqualified-friend",
"-Wno-unknown-argument", # icu
"-Wno-unused-value", # crashpad
"-Wno-deprecated-non-prototype", # zlib
]
} else {
default_warning_flags += [
@ -583,7 +579,6 @@ if (is_win) {
default_warning_flags += [
"-Wno-tautological-constant-compare",
"-Wno-unused-but-set-variable", # icu
"-Wno-deprecated-non-prototype", # zlib
]
} else {
default_warning_flags +=

View file

@ -20,15 +20,6 @@ if (use_goma) {
goma_prefix = ""
}
# Goma doesn't support the host-arm64 toolchain, so continue using Rosetta.
if (host_cpu == "arm64" && !use_goma) {
rebased_clang_dir =
rebase_path("//buildtools/mac-arm64/clang/bin", root_build_dir)
} else {
rebased_clang_dir =
rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
}
# Shared toolchain definition. Invocations should set toolchain_os to set the
# build args in this definition.
template("mac_toolchain") {
@ -220,10 +211,28 @@ template("mac_toolchain") {
}
}
# Toolchain used for Mac host targets.
mac_toolchain("clang_x64") {
toolchain_cpu = "x64"
toolchain_os = "mac"
prefix = rebased_clang_dir
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
cc = "${goma_prefix}$prefix/clang"
cxx = "${goma_prefix}$prefix/clang++"
ar = "${prefix}/llvm-ar"
ld = cxx
strip = "strip"
is_clang = true
if (mac_enable_relative_sdk_path) {
mac_sdk_path = rebase_path(mac_sdk_path, root_build_dir)
}
sysroot_flags = "-isysroot $mac_sdk_path -mmacosx-version-min=$mac_sdk_min"
}
# Toolchain used for Mac host (i386) targets.
mac_toolchain("clang_x86") {
toolchain_cpu = "i386"
toolchain_os = "mac"
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
cc = "${goma_prefix}$prefix/clang"
cxx = "${goma_prefix}$prefix/clang++"
ar = "${prefix}/llvm-ar"
@ -239,7 +248,7 @@ mac_toolchain("clang_x64") {
mac_toolchain("clang_arm64") {
toolchain_cpu = "arm64"
toolchain_os = "mac"
prefix = rebased_clang_dir
prefix = rebase_path("//buildtools/mac-x64/clang/bin", root_build_dir)
cc = "${goma_prefix}$prefix/clang"
cxx = "${goma_prefix}$prefix/clang++"
ar = "${prefix}/llvm-ar"

View file

@ -59,21 +59,6 @@ config("dart_precompiled_runtime_config") {
"DART_PRECOMPILED_RUNTIME",
"EXCLUDE_CFE_AND_KERNEL_PLATFORM",
]
if (is_mac) {
# We create an empty __space_for_note section in a __CUSTOM segment to
# reserve the header space needed for inserting a snapshot into the
# executable when creating standalone executables. This segment and section
# is removed in standalone executables, replaced with a note that points to
# the snapshot in the file.
#
# (A segment load command with a single section is 132 bytes in 32-bit
# executables and 152 bytes in 64-bit ones, and a note load command is
# always 40 bytes.)
#
# Keep this in sync with the constants reservedSegmentName and
# reservedSectionName in pkg/dart2native/lib/macho_utils.dart.
ldflags = [ "-Wl,-add_empty_section,__CUSTOM,__space_for_note" ]
}
}
# Controls DART_PRECOMPILER #define.

View file

@ -11,9 +11,9 @@
namespace dart {
#if defined(DEBUG)
const intptr_t kSkipCount = 7;
#elif !(defined(PRODUCT) || defined(DEBUG))
const intptr_t kSkipCount = 6;
#elif !(defined(PRODUCT) || defined(DEBUG))
const intptr_t kSkipCount = 5;
#endif
} // namespace dart