Skip to content

Commit e3340af

Browse files
committed
dart-sdk: support two level namespace for macOS
1 parent 668fa80 commit e3340af

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Formula/d/dart-sdk.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ def install
4242
system "gclient", "config", "--name", "sdk", "https://dart.googlesource.com/sdk.git@#{version}"
4343
system "gclient", "sync", "--no-history"
4444

45+
# Workaround for error: 'readdir_r' is deprecated
46+
# Issue ref: https://github.com/dart-lang/sdk/issues/63089
47+
inreplace "sdk/build/config/compiler/BUILD.gn",
48+
"\"-Wno-tautological-constant-compare\",",
49+
"\\0\n \"-Wno-deprecated-declarations\","
50+
51+
# Workaround for dependants audit failure: Libraries were compiled with a flat namespace.
52+
# Issue ref: https://github.com/dart-lang/sdk/issues/63115
53+
# PR ref: https://github.com/dart-lang/sdk/pull/63116
54+
inreplace "sdk/runtime/platform/mach_o.h",
55+
"MH_NO_REEXPORTED_DYLIBS = 0x100000;",
56+
"\\0\nstatic constexpr uint32_t MH_TWOLEVEL = 0x80;"
57+
inreplace "sdk/runtime/vm/mach_o.cc", "MH_NO_REEXPORTED_DYLIBS", "\\0 | mach_o::MH_TWOLEVEL"
58+
4559
chdir "sdk" do
4660
arch = Hardware::CPU.arm? ? "arm64" : "x64"
4761
system "./tools/build.py", "--mode=release", "--arch=#{arch}", "create_sdk"

0 commit comments

Comments
 (0)