]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] cmd/dist: power64/power64le support.
authorShenghou Ma <minux@golang.org>
Thu, 7 Aug 2014 03:59:14 +0000 (23:59 -0400)
committerShenghou Ma <minux@golang.org>
Thu, 7 Aug 2014 03:59:14 +0000 (23:59 -0400)
LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/117670045

src/cmd/dist/build.c
src/cmd/dist/buildruntime.c

index 2e0f5b6360e30f7cf4145c14e1ffac388fe69e0a..1feeccf4176c3d23e2650f7a4c920938e958e1f3 100644 (file)
@@ -347,6 +347,7 @@ static char *oldtool[] = {
        "5a", "5c", "5g", "5l",
        "6a", "6c", "6g", "6l",
        "8a", "8c", "8g", "8l",
+       "9a", "9c", "9g", "9l",
        "6cov",
        "6nm",
        "6prof",
@@ -553,6 +554,11 @@ static struct {
                "../cc/pswt.c",
                "$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/libcc.a",
        }},
+       {"cmd/9c", {
+               "../cc/pgen.c",
+               "../cc/pswt.c",
+               "$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/libcc.a",
+       }},
        {"cmd/5g", {
                "../gc/cplx.c",
                "../gc/pgen.c",
@@ -577,6 +583,14 @@ static struct {
                "../gc/popt.h",
                "$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/libgc.a",
        }},
+       {"cmd/9g", {
+               "../gc/cplx.c",
+               "../gc/pgen.c",
+               "../gc/plive.c",
+               "../gc/popt.c",
+               "../gc/popt.h",
+               "$GOROOT/pkg/obj/$GOHOSTOS_$GOHOSTARCH/libgc.a",
+       }},
        {"cmd/5l", {
                "../ld/*",
        }},
@@ -586,6 +600,9 @@ static struct {
        {"cmd/8l", {
                "../ld/*",
        }},
+       {"cmd/9l", {
+               "../ld/*",
+       }},
        {"cmd/go", {
                "zdefaultcc.go",
        }},
@@ -1178,12 +1195,26 @@ shouldbuild(char *file, char *dir)
        
        // Check file name for GOOS or GOARCH.
        name = lastelem(file);
-       for(i=0; i<nelem(okgoos); i++)
-               if(contains(name, okgoos[i]) && !streq(okgoos[i], goos))
+       for(i=0; i<nelem(okgoos); i++) {
+               if(streq(okgoos[i], goos))
+                       continue;
+               p = xstrstr(name, okgoos[i]);
+               if(p == nil)
+                       continue;
+               p += xstrlen(okgoos[i]);
+               if(*p == '.' || *p == '_' || *p == '\0')
                        return 0;
-       for(i=0; i<nelem(okgoarch); i++)
-               if(contains(name, okgoarch[i]) && !streq(okgoarch[i], goarch))
+       }
+       for(i=0; i<nelem(okgoarch); i++) {
+               if(streq(okgoarch[i], goarch))
+                       continue;
+               p = xstrstr(name, okgoarch[i]);
+               if(p == nil)
+                       continue;
+               p += xstrlen(okgoarch[i]);
+               if(*p == '.' || *p == '_' || *p == '\0')
                        return 0;
+       }
 
        // Omit test files.
        if(contains(name, "_test"))
@@ -1381,6 +1412,10 @@ static char *cleantab[] = {
        "cmd/8c",
        "cmd/8g",
        "cmd/8l",
+       "cmd/9a",
+       "cmd/9c",
+       "cmd/9g",
+       "cmd/9l",
        "cmd/cc",
        "cmd/gc",
        "cmd/go",       
index b16b5756ccd58e94ff0469a3555f3d66d42b651f..9b40a596861cd98ce29cb017c3ccc814f95d51fc 100644 (file)
@@ -148,6 +148,13 @@ static struct {
        {"arm", "",
        "#define        LR      R14\n"
        },
+
+       {"power64", "",
+       "#define        g       R30\n"
+       },
+       {"power64le", "",
+       "#define        g       R30\n"
+       },
 };
 
 #define MAXWINCB 2000 /* maximum number of windows callbacks allowed */