if Thearch.Thechar == '6' {
obj.Flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel)
}
- if Thearch.Thechar == '6' || Thearch.Thechar == '9' {
+ if Thearch.Thechar == '6' || Thearch.Thechar == '8' || Thearch.Thechar == '9' {
flag.BoolVar(&flag_dynlink, "dynlink", false, "support references to Go symbols defined in other shared libraries")
}
obj.Flagstr("cpuprofile", "write cpu profile to `file`", &cpuprofile)
codegenArg = "-fPIC"
} else {
switch platform {
- case "linux/amd64":
+ case "linux/386", "linux/amd64":
+ buildAsmflags = append(buildAsmflags, "-D=shared=1")
default:
fatalf("-buildmode=shared not supported on %s\n", platform)
}
if gccgo {
codegenArg = "-fPIC"
} else {
- if platform != "linux/amd64" {
- fmt.Fprintf(os.Stderr, "go %s: -linkshared is only supported on linux/amd64\n", flag.Args()[0])
- os.Exit(2)
+ switch platform {
+ case "linux/386", "linux/amd64":
+ buildAsmflags = append(buildAsmflags, "-D=shared=1")
+ default:
+ fatalf("-buildmode=shared not supported on %s\n", platform)
}
codegenArg = "-dynlink"
// TODO(mwhudson): remove -w when that gets fixed in linker.