
This is a big commit that does a few things: * It moves CGo processing into a separate package. It never really belonged in the loader package, and certainly not now that the loader package may be refactored into a driver package. * It adds support for multiple CGo files (files that import package "C") in a single package. Previously, this led to multiple definition errors in the Go typecheck phase because certain C symbols were defined multiple times in all the files. Now it generates a new fake AST that defines these, to avoid multiple definition errors. * It improves debug info in a few edge cases that are probably not relevant outside of bugs in cgo itself.
11 строки
258 Б
Go
11 строки
258 Б
Go
// +build !byollvm
|
|
|
|
package cgo
|
|
|
|
/*
|
|
#cgo linux CFLAGS: -I/usr/lib/llvm-8/include
|
|
#cgo darwin CFLAGS: -I/usr/local/opt/llvm/include
|
|
#cgo linux LDFLAGS: -L/usr/lib/llvm-8/lib -lclang
|
|
#cgo darwin LDFLAGS: -L/usr/local/opt/llvm/lib -lclang -lffi
|
|
*/
|
|
import "C"
|