]> Cypherpunks.ru repositories - gostls13.git/blobdiff - misc/cgo/testcarchive/carchive_test.go
cmd/dist,internal/platform: reenable the c-archive build mode on ios
[gostls13.git] / misc / cgo / testcarchive / carchive_test.go
index 30e12be6c64bb6b5348ac24049740b42bc6ef527..8a39c24a6dcc1134fea38447d92e95c35137cf24 100644 (file)
@@ -132,6 +132,15 @@ func testMain(m *testing.M) int {
                // in .text section.
                cc = append(cc, "-Wl,-bnoobjreorder")
        }
+       if GOOS == "ios" {
+               // Linking runtime/cgo on ios requires the CoreFoundation framework because
+               // x_cgo_init uses CoreFoundation APIs to switch directory to the app root.
+               //
+               // TODO(#58225): This special case probably should not be needed.
+               // runtime/cgo is a very low-level package, and should not provide
+               // high-level behaviors like changing the current working directory at init.
+               cc = append(cc, "-framework", "CoreFoundation")
+       }
        libbase := GOOS + "_" + GOARCH
        if runtime.Compiler == "gccgo" {
                libbase = "gccgo_" + libgodir + "_fPIC"