diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index 362ae8c556a7..3caf66e2cf83 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -18,6 +18,12 @@ import("../build/executable_suffix.gni") import("../sdk_args.gni") import("../utils/application_snapshot.gni") +# If we're are embedded in another GN buildroot, such as Flutter, the sysroot +# might already be imported from elsewhere. +if (get_path_info(".", "abspath") == "//sdk/") { + import("../build/config/sysroot.gni") +} + declare_args() { # Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries. dart_platform_sdk = true @@ -379,10 +385,11 @@ copy_sanitizer_deps = [] # If the default toolchain is already using a sanitizer, the sanitizer variant # toolchains will try to use multiple sanitizers at the same time, which # doesn't work. If we're not on Linux, the sanitizers are not statically linked -# and not useable outside our tree. If we're are embedded in another GN -# buildroot, such as Flutter, the sanitizer variant toolchains might not be -# defined. +# and not useable outside our tree. If we're on Linux with musl-libc, the +# sanitizers don't work. If we're are embedded in another GN buildroot, such as +# Flutter, the sanitizer variant toolchains might not be defined. if (!using_sanitizer && current_os == "linux" && + !(defined(dart_sysroot) && dart_sysroot == "alpine") && get_path_info(".", "abspath") == "//sdk/") { sanitizers = [] if (current_cpu == "x64" || current_cpu == "arm64") {