Skip to content

Commit 88f254c

Browse files
ntkmeCommit Queue
authored andcommitted
[build] Don't include sanitizer AOT runtimes for musl-libc
Closes #62151 GitOrigin-RevId: cb16ab5 Change-Id: I20902c5a09c766c13d31de59d214a62cc6357c9a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465800 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Slava Egorov <[email protected]>
1 parent 306cb04 commit 88f254c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

sdk/BUILD.gn

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ import("../build/executable_suffix.gni")
1818
import("../sdk_args.gni")
1919
import("../utils/application_snapshot.gni")
2020

21+
# If we're are embedded in another GN buildroot, such as Flutter, the sysroot
22+
# might already be imported from elsewhere.
23+
if (get_path_info(".", "abspath") == "//sdk/") {
24+
import("../build/config/sysroot.gni")
25+
}
26+
2127
declare_args() {
2228
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
2329
dart_platform_sdk = true
@@ -379,10 +385,11 @@ copy_sanitizer_deps = []
379385
# If the default toolchain is already using a sanitizer, the sanitizer variant
380386
# toolchains will try to use multiple sanitizers at the same time, which
381387
# doesn't work. If we're not on Linux, the sanitizers are not statically linked
382-
# and not useable outside our tree. If we're are embedded in another GN
383-
# buildroot, such as Flutter, the sanitizer variant toolchains might not be
384-
# defined.
388+
# and not useable outside our tree. If we're on Linux with musl-libc, the
389+
# sanitizers don't work. If we're are embedded in another GN buildroot, such as
390+
# Flutter, the sanitizer variant toolchains might not be defined.
385391
if (!using_sanitizer && current_os == "linux" &&
392+
!(defined(dart_sysroot) && dart_sysroot == "alpine") &&
386393
get_path_info(".", "abspath") == "//sdk/") {
387394
sanitizers = []
388395
if (current_cpu == "x64" || current_cpu == "arm64") {

0 commit comments

Comments
 (0)