You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a c-archive using the command go build -buildmode=c-archive on Intel-based macOS 14.6 (version 23G80) with Xcode 15.4 (Build version 15F31d), the resulting archive file is invalid.
Reproduction Steps
go build -buildmode=c-archive -o hello.a golang.org/x/mobile/example/basic
The go build command should produce a valid c-archive so xcodebuild -create-xcframework -library hello.a -output hello.xcframework could successfully creates the "hello.xcframework": xcframework successfully written out to: /Users/issue/hello.xcframework.
lipo -info hello.a output: Non-fat file: hello.a is architecture: x86_64
file hello.a output: hello.a: current ar archive random library
hexdump -n80 -C hello.a to show the first 80 bytes (compare these numbers with the ones above):
Go version
go version go1.22.5 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
Description
When building a c-archive using the command go build -buildmode=c-archive on Intel-based macOS 14.6 (version 23G80) with Xcode 15.4 (Build version 15F31d), the resulting archive file is invalid.
Reproduction Steps
go build -buildmode=c-archive -o hello.a golang.org/x/mobile/example/basic
hello.a
is successfully createdxcodebuild -create-xcframework -library hello.a -output hello.xcframework
xcodebuild
fails witherror: unable to find any architecture information in the binary at '/Users/issue/hello.a': Unknown header: 0x50000000
What did you see happen?
xcodebuild
complains that thehello.a
is not a valid binary.lipo -info hello.a
output:Non-fat file: hello.a is architecture: x86_64
file hello.a
output:hello.a: current ar archive
hexdump -n80 -C hello.a
to show the first 80 bytes:What did you expect to see?
The
go build
command should produce a valid c-archive soxcodebuild -create-xcframework -library hello.a -output hello.xcframework
could successfully creates the "hello.xcframework":xcframework successfully written out to: /Users/issue/hello.xcframework
.lipo -info hello.a
output:Non-fat file: hello.a is architecture: x86_64
file hello.a
output:hello.a: current ar archive random library
hexdump -n80 -C hello.a
to show the first 80 bytes (compare these numbers with the ones above):This issues appears to be a platform-specific issue related to Intel macOS 14.6, it is not observed on "Intel macOS 13" or "Apple Silicon macOS 14".
The text was updated successfully, but these errors were encountered: