mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cgo working on linux/386
R=r DELTA=70 (47 added, 4 deleted, 19 changed) OCL=35167 CL=35171
This commit is contained in:
parent
0632bb4ae5
commit
e67a5084b8
10 changed files with 66 additions and 23 deletions
|
|
@ -22,20 +22,34 @@ func usage() {
|
|||
flag.PrintDefaults();
|
||||
}
|
||||
|
||||
const ptrSize = 8 // TODO
|
||||
var ptrSizeMap = map[string]int64 {
|
||||
"386": 4,
|
||||
"amd64": 8,
|
||||
"arm": 4
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = usage;
|
||||
flag.Parse();
|
||||
|
||||
arch := os.Getenv("GOARCH");
|
||||
if arch == "" {
|
||||
fatal("$GOARCH is not set");
|
||||
}
|
||||
ptrSize, ok := ptrSizeMap[arch];
|
||||
if !ok {
|
||||
fatal("unknown architecture %s", arch);
|
||||
}
|
||||
|
||||
args := flag.Args();
|
||||
if len(args) != 1 {
|
||||
usage();
|
||||
os.Exit(2);
|
||||
}
|
||||
p := openProg(args[0]);
|
||||
p.PtrSize = ptrSize;
|
||||
p.Preamble = p.Preamble + "\n" + builtinProlog;
|
||||
p.loadDebugInfo(ptrSize);
|
||||
p.loadDebugInfo();
|
||||
p.Vardef = make(map[string]*Type);
|
||||
p.Funcdef = make(map[string]*FuncType);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue