@@ -18,6 +18,12 @@ import("../build/executable_suffix.gni")
1818import (" ../sdk_args.gni" )
1919import (" ../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+
2127declare_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.
385391if (! 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