New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: unknown pc on macOS Mojave with cgo app built on macOS Catalina #37849
Comments
Adding the -mmacosx-version-min flag to CFLAGS fixes this issue. This seems to be caused by a change in Catalina. Closing. |
Do you know if this is due to a specific C API you were using, or is this a general problem? |
I can reproduce on 10.12.6 (an old mac I have lying around). On 10.15.3,
On 10.12.6, it doesn't:
So it looks like objective C isn't backwards compatible without adding a
When run on 10.15.2, it works fine. On 10.12.6, it prints:
|
Yes. It does look like a general problem with the objective C complier, and adding - mmacosx-version-min flag fixes this. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
(BUILD ENV) Outputgo env
(DEPLOY ENV) OutputWhat did you do?
Built a CGO app that calls objective-c functions from within Go Code. The app was built on macOS catalina. It runs fine on macOS catalina, and crashes with unknown pc on mojave. The code is as follows
main.go
mac_fruits.h
mac_fruits.m
What did you expect to see?
Code running smoothly, with the output
Fruits are [apple orange lemon melon]
What did you see instead?
On macOS Catalina:
Fruits are [apple orange lemon melon]
On macOS Mojave:
Building the app on macOS mojave and running it on macOS catalina poses no issues. Doing it the other way around is causing the crash.
The text was updated successfully, but these errors were encountered: