diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2012-09-19 01:05:25 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2012-09-19 01:05:25 +0400 |
| commit | cc8cfefd8ade736ee75673a16da44575499290f7 (patch) | |
| tree | 3133c5b8a767da94ef8fa619fa97320887b67b7f /src/cmd/ld/lib.c | |
| parent | a29f3136b40c5a3b5da4034fe5def863d4ad2733 (diff) | |
| download | go-cc8cfefd8ade736ee75673a16da44575499290f7.tar.xz | |
race: linker changes
This is the second part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
This change makes the linker emit dependency on runtime/race package when supplied with -b flag.
R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6488074
Diffstat (limited to 'src/cmd/ld/lib.c')
| -rw-r--r-- | src/cmd/ld/lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 2026707c2f..135426473f 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -72,6 +72,8 @@ Lflag(char *arg) void libinit(void) { + char *race; + fmtinstall('i', iconv); fmtinstall('Y', Yconv); fmtinstall('Z', Zconv); @@ -80,7 +82,10 @@ libinit(void) print("goarch is not known: %s\n", goarch); // add goroot to the end of the libdir list. - Lflag(smprint("%s/pkg/%s_%s", goroot, goos, goarch)); + race = ""; + if(debug['b']) + race = "_race"; + Lflag(smprint("%s/pkg/%s_%s%s", goroot, goos, goarch, race)); // Unix doesn't like it when we write to a running (or, sometimes, // recently run) binary, so remove the output file before writing it. @@ -281,6 +286,8 @@ loadlib(void) loadinternal("runtime"); if(thechar == '5') loadinternal("math"); + if(debug['b']) + loadinternal("runtime/race"); for(i=0; i<libraryp; i++) { if(debug['v']) |
