go: crypto/x509/internal/macos: link errors on ios/arm64 due to missing symbols _SecItemExport and _SecTrustEvaluateWithError

ios-arm64-corellium at f041c7e3028545ba39c60d6e20ab9b74c01bbf33

:: Running /bin/bash with args ["bash" "/tmp/workdir-host-ios-arm64-corellium-ios/go/src/make.bash"] and env ["SHELL=/bin/sh" "XPC_FLAGS=0x0" "DYLD_INSERT_LIBRARIES=/usr/lib/pspawn_payload.dylib:/usr/lib/TweakInject.dylib" "TMUX=/tmp//tmux-0/default,132,0" "HOME=/var/root" "GO_BUILDER_ENV=host-ios-arm64-corellium-ios" "SANDBOX_TOKENS=c1bd94996a72965db5823ac10e7459ccbbce059e20ee4152d9bdb34ddecabc09;00;00000000;00000000;00000000;000000000000001c;com.apple.sandbox.executable;01;01000002;0fffffff000054ee;01;/Library:a248e92ac291deec804d9e560eaef74783cf366457936fc3e6130d34d96a62cf;00;00000000;00000000;00000000;000000000000001c;com.apple.sandbox.executable;01;01000002;0fffffff000618a2;01;/Library/MobileSubstrate/DynamicLibraries:3e8bbc2027b091b3cafd0a9984d8638a18b3e629c8e74742aef25894d9c8b54f;00;00000000;00000000;00000000;000000000000001c;com.apple.sandbox.executable;01;01000002;0fffffff00006626;01;/System:fcb11e3fbd53a5a56715b3d49a2803c7f25685efec12787b048c8455ae7c40e4;00;00000000;00000000;00000000;000000000000001c;com.apple.sandbox.executable;00;01000003;0000000000000002;01;/private/var/mnt:e7234a7dd77bbb3ebfbf3cb09706481a1126720066bff5f7ed41a0311ebf1030;00;00000000;00000000;00000000;000000000000001c;com.apple.sandbox.executable;01;01000003;000000000000002e;01;/private/var/mobile/Library:98e3a25a1a068ca7adbfd9c379772de487265a01ace7cfdb48d5f458ffdcf3af;00;00000000;00000000;00000000;0000000000000020;com.apple.app-sandbox.read-write;01;01000003;0000000000000036;01;/private/var/mobile/Library/Preferences" "TERM=screen" "TMUX_PANE=%0" "SHLVL=1" "XPC_SERVICE_NAME=org.golang.builder" "PATH=/var/root/bin:/usr/bin:/bin:/usr/sbin:/sbin" "CC=/var/root/bin/clangwrap" "_=/var/root/go/bin/buildlet" "WORKDIR=/tmp/workdir-host-ios-arm64-corellium-ios" "GO_BUILDER_NAME=ios-arm64-corellium" "GOROOT_BOOTSTRAP=/var/root/go-ios-arm64-bootstrap" "GOBIN=" "TMPDIR=/tmp/workdir-host-ios-arm64-corellium-ios/tmp" "GOCACHE=/tmp/workdir-host-ios-arm64-corellium-ios/gocache" "PWD=/tmp/workdir-host-ios-arm64-corellium-ios/go/src"] in dir /tmp/workdir-host-ios-arm64-corellium-ios/go/src

Building Go cmd/dist using /var/root/go-ios-arm64-bootstrap. (devel +694025e74f Tue Oct 6 01:14:39 2020 +0000 ios/arm64)
Building Go toolchain1 using /var/root/go-ios-arm64-bootstrap.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
warning: unable to find runtime/cgo.a
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for ios/arm64.
# cmd/go
/tmp/workdir-host-ios-arm64-corellium-ios/go/pkg/tool/ios_arm64/link: running /var/root/bin/clangwrap failed: exit status 1
Undefined symbols for architecture arm64:
  "_SecItemExport", referenced from:
      _crypto/x509/internal/macos.x509_SecItemExport_trampoline.abi0 in go.o
  "_SecTrustEvaluateWithError", referenced from:
      _crypto/x509/internal/macos.x509_SecTrustEvaluateWithError_trampoline.abi0 in go.o
ld: symbol(s) not found for architecture arm64
Not signing file
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

# cmd/pprof
/tmp/workdir-host-ios-arm64-corellium-ios/go/pkg/tool/ios_arm64/link: running /var/root/bin/clangwrap failed: exit status 1
Undefined symbols for architecture arm64:
  "_SecItemExport", referenced from:
      _crypto/x509/internal/macos.x509_SecItemExport_trampoline.abi0 in go.o
  "_SecTrustEvaluateWithError", referenced from:
      _crypto/x509/internal/macos.x509_SecTrustEvaluateWithError_trampoline.abi0 in go.o
ld: symbol(s) not found for architecture arm64
Not signing file
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

# cmd/trace
/tmp/workdir-host-ios-arm64-corellium-ios/go/pkg/tool/ios_arm64/link: running /var/root/bin/clangwrap failed: exit status 1
Undefined symbols for architecture arm64:
  "_SecItemExport", referenced from:
      _crypto/x509/internal/macos.x509_SecItemExport_trampoline.abi0 in go.o
  "_SecTrustEvaluateWithError", referenced from:
      _crypto/x509/internal/macos.x509_SecTrustEvaluateWithError_trampoline.abi0 in go.o
ld: symbol(s) not found for architecture arm64
Not signing file
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

go tool dist: FAILED: /tmp/workdir-host-ios-arm64-corellium-ios/go/pkg/tool/ios_arm64/go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 2

greplogs --dashboard -md -l -e '(?m)Undefined symbols for architecture arm64:\n\s*"_SecItemExport"'

2021-11-16T15:16:54-f041c7e/ios-arm64-corellium 2021-11-16T15:16:41-46e98d4/ios-arm64-corellium 2021-11-16T14:33:48-50dac3b/ios-arm64-corellium 2021-11-16T14:33:39-67c1556/ios-arm64-corellium 2021-11-16T14:02:36-bddb79f/ios-arm64-corellium 2021-11-16T13:48:46-9efb649/ios-arm64-corellium 2021-11-16T08:58:05-6e481c0/ios-arm64-corellium 2021-11-16T07:47:15-6b3f4d3/ios-arm64-corellium 2021-11-16T07:47:08-313cae3/ios-arm64-corellium 2021-11-16T06:36:08-a52e4b9/ios-arm64-corellium 2021-11-16T06:31:54-febbef5/ios-arm64-corellium 2021-11-16T05:58:03-fdd6793/ios-arm64-corellium 2021-11-16T05:36:07-8656895/ios-arm64-corellium 2021-11-15T23:55:09-9e13a88/ios-arm64-corellium 2021-11-15T23:01:05-d156101/ios-arm64-corellium 2021-11-15T21:22:19-95e85e3/ios-arm64-corellium 2021-11-15T21:22:18-c8d7c5f/ios-arm64-corellium 2021-11-15T21:22:17-e08aae2/ios-arm64-corellium 2021-11-15T21:22:15-fda9261/ios-arm64-corellium 2021-11-15T21:22:14-42fa03a/ios-arm64-corellium 2021-11-15T21:22:13-0a54a68/ios-arm64-corellium 2021-11-15T21:22:12-cfcd717/ios-arm64-corellium 2021-11-15T21:22:11-0a39e4a/ios-arm64-corellium 2021-11-15T21:22:09-184ca3c/ios-arm64-corellium 2021-11-15T21:21:51-560dc97/ios-arm64-corellium 2021-11-15T19:24:28-9265558/ios-arm64-corellium 2021-11-15T18:43:13-b6342a0/ios-arm64-corellium 2021-11-15T18:43:07-0e65410/ios-arm64-corellium 2021-11-15T18:02:28-1dc9af5/ios-arm64-corellium 2021-11-15T17:10:25-f986191/ios-arm64-corellium 2021-11-15T15:42:24-ce4a275/ios-arm64-corellium 2021-11-14T17:38:42-5337e53/ios-arm64-corellium 2021-11-14T16:54:11-dfa62c7/ios-arm64-corellium 2021-11-13T03:33:55-c239790/ios-arm64-corellium 2021-11-13T02:30:25-c546052/ios-arm64-corellium 2021-11-13T01:39:23-c78a267/ios-arm64-corellium 2021-11-13T01:39:09-e658c42/ios-arm64-corellium 2021-11-13T01:37:51-2fd720b/ios-arm64-corellium 2021-11-13T00:50:04-c893a85/ios-arm64-corellium 2021-11-13T00:49:51-530e320/ios-arm64-corellium 2021-11-13T00:37:53-958f405/ios-arm64-corellium 2021-11-13T00:36:41-c97d681/ios-arm64-corellium 2021-11-13T00:34:41-bfbe5ac/ios-arm64-corellium 2021-11-13T00:26:24-787708a/ios-arm64-corellium 2021-11-13T00:26:23-bc0b98e/ios-arm64-corellium 2021-11-13T00:26:21-56e55a3/ios-arm64-corellium 2021-11-13T00:26:20-c09d854/ios-arm64-corellium 2021-11-13T00:23:16-39bc666/ios-arm64-corellium 2021-11-12T23:35:31-b69b2f6/ios-arm64-corellium 2021-11-12T23:34:09-fdee1b2/ios-arm64-corellium 2021-11-12T23:26:33-3a4b950/ios-arm64-corellium 2021-11-12T23:07:14-429d1e0/ios-arm64-corellium 2021-11-12T23:07:01-c8d6ee1/ios-arm64-corellium 2021-11-12T22:50:32-1cd6003/ios-arm64-corellium 2021-11-12T22:20:51-f9dcda3/ios-arm64-corellium 2021-11-12T22:20:50-9150c16/ios-arm64-corellium 2021-11-12T21:06:35-3634594/ios-arm64-corellium 2021-11-12T20:20:57-76fbd61/ios-arm64-corellium 2021-11-12T20:02:21-9519651/ios-arm64-corellium 2021-11-12T19:45:58-ecd2e14/ios-arm64-corellium 2021-11-12T18:57:22-b1b6d92/ios-arm64-corellium 2021-11-12T18:48:59-5d24203/ios-arm64-corellium 2021-11-12T18:14:22-8b66b3d/ios-arm64-corellium

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (25 by maintainers)

Commits related to this issue

Most upvoted comments

With the builder updates that @changkun performed, and as of CL 368054 landing, the iOS builder is passing. If I understand correctly, there’s nothing more to do for this issue, right?

If so, I’ll send a CL that removes the builder’s known issue.

Looking at #48076, it feels like raising the minimum version to iOS 12 is the right choice for Go 1.18, regardless of the complete policy. This fortunately solves our problem here, too.

SGTM. Thanks.

This is a two part issue:

(1) we used an API which is only available on macOS, so it’s obviously unavailable on iOS. CL364554 switches to an API available on both. (2) SecTrustEvaluateWithError is available on iOS, as of 12.0. The builders use iOS 14.6, but the clang wrapper sets the minimum version to 6.0, and the SDK in use is for 11.2 (there appears to be no real documentation of this. Bumping the minimum version to 12.0, and updating the SDK to a modern one (14.5) appears to fix these issues.

I’ve sent a CL for (1), but I’m not sure how best to go about fixing (2). I can send a CL which bumps the min version, but the SDK on the builders needs to be bumped, but that appears to be supplied OOB (and the only instructions appear to be for a new instance, and I can’t see any documentation for what to do if we need to make changes? Possibly wipe the instance and re-initialize?)