-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
arch-x86_6464-bit x8664-bit x86bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorlinkingos-macos
Milestone
Description
Zig Version
0.9.1
Steps to Reproduce
I'm trying to compile a hello world CGO program using the zig toolchain.
I get an error when compiling with zig.
The program is
package main
import "C"
import "fmt"
func main() {
fmt.Println(C.int(10))
}
My build command is
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 CC="zig cc -target x86_64-macos" CXX="zig c++ -target x86_64-macos" go build
My system:
- Macos Catalina 10.15.7
- Apple clang version 12.0.0
- zig 0.9.1
- go version go1.18 darwin/amd64
Expected Behavior
the program builds
Actual Behavior
the build fails with a link error
warning: unsupported linker arg: -headerpad
warning: unsupported linker arg: 1144
warning: unsupported linker arg: -no_pie
warning: unsupported linker arg: -pagezero_size
warning: unsupported linker arg: 4000000
/usr/local/go/pkg/tool/darwin_amd64/link: /usr/local/go/pkg/tool/darwin_amd64/link: running dsymutil failed: exit status 1
LLVM ERROR: Malformed MachO file.
emcfarlane
Metadata
Metadata
Assignees
Labels
arch-x86_6464-bit x8664-bit x86bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorlinkingos-macos