obj.Flagcount("y", "debug declarations in canned imports (with -d)", &Debug['y'])
var flag_shared int
var flag_dynlink bool
+ if Thearch.Thechar == '6' || Thearch.Thechar == '5' {
+ obj.Flagcount("shared", "generate code that can be linked into a shared library", &flag_shared)
+ }
if Thearch.Thechar == '6' {
obj.Flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel)
- obj.Flagcount("shared", "generate code that can be linked into a shared library", &flag_shared)
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/amd64", "linux/arm", "android/arm":
codegenArg = "-shared"
- case "linux/arm":
- buildAsmflags = append(buildAsmflags, "-shared")
case "darwin/amd64":
- case "android/arm":
default:
fatalf("-buildmode=c-shared not supported on %s\n", platform)
}