]> Cypherpunks repositories - gostls13.git/commitdiff
build: pass $GCFLAGS to compiler
authorRuss Cox <rsc@golang.org>
Tue, 18 Oct 2011 18:55:10 +0000 (14:55 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 18 Oct 2011 18:55:10 +0000 (14:55 -0400)
For example, if you are debugging an optimization
problem you can now run

        GCFLAGS=-N gotest

This is a convention for make, not for the general build,
so it may go away or be done differently in the eventual
'go' command.

The plan is that people will be able to test their code for
rune safety by doing GCFLAGS=-r.

R=golang-dev, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5294042

src/Make.cmd
src/Make.pkg
test/run

index 27c6a2e13467071d2ca588d3a384dfa806b93646..d663edbffcf0d70aca67666de53a92a148825785 100644 (file)
@@ -20,7 +20,7 @@ $(TARG): _go_.$O
        $(LD) $(LDIMPORTS) -o $@ _go_.$O
 
 _go_.$O: $(GOFILES) $(PREREQ)
-       $(GC) $(GCIMPORTS) -o $@ $(GOFILES)
+       $(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES)
 
 install: $(TARGDIR)/$(TARG)
 
@@ -44,7 +44,7 @@ _test/main.a: _gotest_.$O
        gopack grc $@ _gotest_.$O
 
 _gotest_.$O: $(GOFILES) $(GOTESTFILES)
-       $(GC) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
+       $(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
 
 importpath:
        echo main
index ad7d10bebfb0451d95a35c237f20934bbc0b401d..6d0ba987f9c27dd6bd49c8795340e0b98711e6e5 100644 (file)
@@ -83,10 +83,10 @@ $(TARGDIR)/$(TARG).a: _obj/$(TARG).a
        cp _obj/$(TARG).a "$@"
 
 _go_.$O: $(GOFILES) $(PREREQ)
-       $(GC) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES)
+       $(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES)
 
 _gotest_.$O: $(GOFILES) $(GOTESTFILES) $(PREREQ)
-       $(GC) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GOTESTFILES)
+       $(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GOTESTFILES)
 
 _obj/$(TARG).a: _go_.$O $(OFILES)
        @mkdir -p _obj/$(dir)
index 533b0d824b7c4988e5490a8dbca35ca8e0ae49b4..03c91ee30ee3cea462898ca0f6ae89d2c51c1de3 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -23,7 +23,7 @@ Xarm)
        exit 1
 esac
 
-export G=${A}g
+export G="${A}g ${GCFLAGS}"
 export L=${A}l
 export GOTRACEBACK=0
 export LANG=C