@@ -72,11 +72,29 @@ use [gomobile](https://github.com/golang/mobile) .
7272
7373### iOS && macOS
7474
75+ > [ !WARNING]
76+ > ** Use only one Go runtime per process.** Go does not support loading multiple
77+ > independently built Go runtimes into one process. Both the cgo and gomobile
78+ > Apple artifacts embed a Go runtime. Do not link ` LibXray.xcframework `
79+ > together with another independently built Go or gomobile framework into the
80+ > same app or extension executable. Doing so can fail at link time or crash
81+ > during runtime initialization, before application code or
82+ > ` NEPacketTunnelProvider ` runs.
83+ > If one process needs Go packages from several frameworks, include those
84+ > packages in the same Go build or ` gomobile bind ` invocation and produce one
85+ > framework so they share a runtime. Merely repackaging or merging independently
86+ > built frameworks is not sufficient. The containing app and a Network
87+ > Extension are separate processes, so apply this rule independently to each
88+ > target. See [ Go #18976 ] ( https://github.com/golang/go/issues/18976#issuecomment-308505600 ) ,
89+ > [ x/mobile #15956 ] ( https://github.com/golang/go/issues/15956#issuecomment-373709423 ) ,
90+ > and [ libXray #116 ] ( https://github.com/XTLS/libXray/issues/116 ) .
91+
7592#### 1. use gomobile
7693
7794Need "iOS Simulator Runtime".
7895
79- This is the best choice for general scenarios and will not conflict with other frameworks.
96+ This is the best choice for general scenarios. The single-runtime restriction
97+ above still applies when linking other Go-based frameworks.
8098
8199Supports iOS, iOSSimulator, macOS, macCatalyst.
82100
0 commit comments