]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc, cmd/ld: rename -b to -race
authorRuss Cox <rsc@golang.org>
Mon, 7 Jan 2013 03:47:39 +0000 (22:47 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 7 Jan 2013 03:47:39 +0000 (22:47 -0500)
There's no b in race detector.
The new flag matches the one in the go command
(go test -race math).

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7072043

src/cmd/5l/obj.c
src/cmd/6l/obj.c
src/cmd/8l/obj.c
src/cmd/gc/go.h
src/cmd/gc/lex.c
src/cmd/gc/pgen.c
src/cmd/gc/reflect.c
src/cmd/go/build.go
src/cmd/ld/lib.c
src/cmd/ld/lib.h

index 4e2b4d44ecd3e4e7a7f77927ee2cb7f29dc96db9..a99f67d94919409dee60eda9c0b92086e3b57c5a 100644 (file)
@@ -109,7 +109,6 @@ main(int argc, char *argv[])
        flagfn2("X", "name value: define string data", addstrdata);
        flagcount("Z", "clear stack frame on entry", &debug['Z']);
        flagcount("a", "disassemble output", &debug['a']);
-       flagcount("b", "race detection", &debug['b']);
        flagcount("c", "dump call graph", &debug['c']);
        flagcount("d", "disable dynamic executable", &debug['d']);
        flagcount("f", "ignore version mismatch", &debug['f']);
@@ -119,6 +118,7 @@ main(int argc, char *argv[])
        flagstr("o", "outfile: set output file", &outfile);
        flagcount("p", "insert profiling code", &debug['p']);
        flagstr("r", "dir1:dir2:...: set ELF dynamic linker search path", &rpath);
+       flagcount("race", "enable race detector", &flag_race);
        flagcount("s", "disable symbol table", &debug['s']);
        flagcount("u", "reject unsafe packages", &debug['u']);
        flagcount("v", "print link trace", &debug['v']);
index 56f3df768c4e6f17c549d3f52b8dc785010d7699..3d90cb38f293eaac939f400fe81b890407fe432f 100644 (file)
@@ -103,7 +103,6 @@ main(int argc, char *argv[])
        flagfn2("X", "name value: define string data", addstrdata);
        flagcount("Z", "clear stack frame on entry", &debug['Z']);
        flagcount("a", "disassemble output", &debug['a']);
-       flagcount("b", "race detection", &debug['b']);
        flagcount("c", "dump call graph", &debug['c']);
        flagcount("d", "disable dynamic executable", &debug['d']);
        flagcount("f", "ignore version mismatch", &debug['f']);
@@ -113,6 +112,7 @@ main(int argc, char *argv[])
        flagstr("o", "outfile: set output file", &outfile);
        flagcount("p", "insert profiling code", &debug['p']);
        flagstr("r", "dir1:dir2:...: set ELF dynamic linker search path", &rpath);
+       flagcount("race", "enable race detector", &flag_race);
        flagcount("s", "disable symbol table", &debug['s']);
        flagcount("u", "reject unsafe packages", &debug['u']);
        flagcount("v", "print link trace", &debug['v']);
index 5d32dfee73504f0f3b7ae360946e3e8b23f147e6..a7c7464f2eb767a60eb61c7ce23fa7b25ff67fe4 100644 (file)
@@ -109,7 +109,6 @@ main(int argc, char *argv[])
        flagfn2("X", "name value: define string data", addstrdata);
        flagcount("Z", "clear stack frame on entry", &debug['Z']);
        flagcount("a", "disassemble output", &debug['a']);
-       flagcount("b", "race detection", &debug['b']);
        flagcount("c", "dump call graph", &debug['c']);
        flagcount("d", "disable dynamic executable", &debug['d']);
        flagcount("f", "ignore version mismatch", &debug['f']);
@@ -118,6 +117,7 @@ main(int argc, char *argv[])
        flagstr("o", "outfile: set output file", &outfile);
        flagcount("p", "insert profiling code", &debug['p']);
        flagstr("r", "dir1:dir2:...: set ELF dynamic linker search path", &rpath);
+       flagcount("race", "enable race detector", &flag_race);
        flagcount("s", "disable symbol table", &debug['s']);
        flagcount("n", "dump symbol table", &debug['n']);
        flagcount("u", "reject unsafe packages", &debug['u']);
index 59f5e7388ec6d9121551f69ee43713ed98d2d90e..adca665ef7da2c32be8ed96ca782ca56b3f2eda3 100644 (file)
@@ -939,6 +939,7 @@ EXTERN      int     typecheckok;
 EXTERN int     compiling_runtime;
 EXTERN int     compiling_wrappers;
 EXTERN int     pure_go;
+EXTERN int     flag_race;
 
 EXTERN int     nointerface;
 EXTERN int     fieldtrack_enabled;
index 1073b985cce265708d1640cd336320bca95b23ec..3415d8f0de51828e59f63e658c8e800524e75454 100644 (file)
@@ -238,7 +238,6 @@ main(int argc, char *argv[])
        flagcount("S", "print assembly listing", &debug['S']);
        flagfn0("V", "print compiler version", doversion);
        flagcount("W", "debug parse tree after type checking", &debug['W']);
-       flagcount("b", "enable race detector", &debug['b']);
        flagcount("complete", "compiling complete package (no C or assembly)", &pure_go);
        flagcount("d", "debug declarations", &debug['d']);
        flagcount("e", "no limit on number of errors reported", &debug['e']);
@@ -252,6 +251,7 @@ main(int argc, char *argv[])
        flagstr("o", "obj: set output file", &outfile);
        flagstr("p", "path: set expected package import path", &myimportpath);
        flagcount("r", "debug generated wrappers", &debug['r']);
+       flagcount("race", "enable race detector", &flag_race);
        flagcount("s", "warn about composite literals that can be simplified", &debug['s']);
        flagcount("u", "reject unsafe code", &safemode);
        flagcount("v", "increase debug verbosity", &debug['v']);
@@ -261,7 +261,7 @@ main(int argc, char *argv[])
 
        flagparse(&argc, &argv, usage);
 
-       if(debug['b']) {
+       if(flag_race) {
                racepkg = mkpkg(strlit("runtime/race"));
                racepkg->name = "race";
        }
@@ -567,7 +567,7 @@ findpkg(Strlit *name)
        }
        if(goroot != nil) {
                race = "";
-               if(debug['b'])
+               if(flag_race)
                        race = "_race";
                snprint(namebuf, sizeof(namebuf), "%s/pkg/%s_%s%s/%Z.a", goroot, goos, goarch, race, name);
                if(access(namebuf, 0) >= 0)
index e388fe6a5eb4e2d27b6acaee4bf7466d40749bd6..a07ad773425c99c89c199e4fb5cd6fe9dfb1dedf 100644 (file)
@@ -66,7 +66,7 @@ compile(Node *fn)
        walk(curfn);
        if(nerrors != 0)
                goto ret;
-       if(debug['b'])
+       if(flag_race)
                racewalk(curfn);
        if(nerrors != 0)
                goto ret;
index 849a1edb27b520bf7f394ae90fc9efc3f10bbf1c..b8eb79938892942c5cbaa10be122dca25fc51b89 100644 (file)
@@ -980,7 +980,7 @@ dumptypestructs(void)
 
                // add paths for runtime and main, which 6l imports implicitly.
                dimportpath(runtimepkg);
-               if(debug['b'])
+               if(flag_race)
                        dimportpath(racepkg);
                dimportpath(mkpkg(strlit("main")));
        }
index 5975e0bfc07d03c50e16bd5d995c9439492b0004..8db752bd91c73ba8c778ba9790aad16537c91acd 100644 (file)
@@ -1892,8 +1892,8 @@ func raceInit() {
                fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
                os.Exit(2)
        }
-       buildGcflags = append(buildGcflags, "-b")
-       buildLdflags = append(buildLdflags, "-b")
+       buildGcflags = append(buildGcflags, "-race")
+       buildLdflags = append(buildLdflags, "-race")
        buildCcflags = append(buildCcflags, "-D", "RACE")
        buildContext.InstallTag = "race"
        buildContext.BuildTags = append(buildContext.BuildTags, "race")
index 4b91af6eb4e7f8b68cc08f2aeb81da4433ceb697..70c2b5540d2f8934a253a2ce2cf72a823dd559a6 100644 (file)
@@ -83,7 +83,7 @@ libinit(void)
 
        // add goroot to the end of the libdir list.
        race = "";
-       if(debug['b'])
+       if(flag_race)
                race = "_race";
        Lflag(smprint("%s/pkg/%s_%s%s", goroot, goos, goarch, race));
 
@@ -286,7 +286,7 @@ loadlib(void)
        loadinternal("runtime");
        if(thechar == '5')
                loadinternal("math");
-       if(debug['b'])
+       if(flag_race)
                loadinternal("runtime/race");
 
        for(i=0; i<libraryp; i++) {
index cc9e2dac605f272ba4a5f12cba3658a583fdc534..92d458a14c731c3a0d00d549369e7cbfef3b0ba8 100644 (file)
@@ -135,6 +135,7 @@ EXTERN      int     ndynexp;
 EXTERN int     havedynamic;
 EXTERN int     iscgo;
 EXTERN int     elfglobalsymndx;
+EXTERN int     flag_race;
 EXTERN char*   tracksym;
 EXTERN char*   interpreter;