Commit a091d2e6 authored by Russ Cox's avatar Russ Cox

cmd/gc, cmd/ld: rename -b to -race

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
parent 0f64a6ef
......@@ -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']);
......
......@@ -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']);
......
......@@ -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']);
......
......@@ -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;
......
......@@ -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)
......
......@@ -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;
......
......@@ -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")));
}
......
......@@ -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")
......
......@@ -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++) {
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment