Skip to content

kujenga/brokencgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Broken Cgo on macOS

This repository contains a minimal example of broken behavior I'm experiencing with Go code compiled with cgo.

  • macOS version: 10.12.4
  • Xcode Command Line Tools version: 8.3

Output of Failure

Running pure Go code works, but running Go with cgo support fails. The failure is exhibited as a 9 kill signal.

$ go run pure/pure.go
Hello, World!
$ go run cgo/cgo.go
signal: killed

Explicitly building/running a binary shows an explicit kill signal.

$ go build -o test ./cgo/
$ ./test
Killed: 9

I am able to run the program with the -s flag passed to through -ldflags, as described in this issue: golang/go#11887

$ go run -ldflags='-s' cgo/cgo.go
Hello from stdio

About

Minimal example of Cgo not working on macOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published