]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.cc] all: merge master (5868ce3) into dev.cc
authorRuss Cox <rsc@golang.org>
Fri, 20 Feb 2015 15:28:36 +0000 (10:28 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 20 Feb 2015 15:28:36 +0000 (10:28 -0500)
This time for sure!

Change-Id: I7e7ea24edb7c2f711489e162fb97237a87533089

1  2 
doc/go1.5.txt
src/cmd/dist/build.go
src/cmd/dist/util.go

diff --combined doc/go1.5.txt
index 680d57145a462435709db681868882fb2c91d7bc,3ec9395e1cbb17cce3d7490a77acbc6598ecef34..d64dfab2c30e1924e8e8ac1ee3d960d82882aa48
@@@ -14,7 -14,9 +14,9 @@@ crypto/tls: change default minimum vers
  encoding/base64: add unpadded encodings (https://golang.org/cl/1511)
  log: add SetOutput functions (https://golang.org/cl/2686, https://golang.org/cl/3023)
  net/http: support for setting trailers from a server Handler (https://golang.org/cl/2157)
+ net/http/cgi: fix REMOTE_ADDR, REMOTE_HOST, add REMOTE_PORT (https://golang.org/cl/4933)
  net/smtp: add TLSConnectionState accessor (https://golang.org/cl/2151)
+ os/signal: add Ignore and Reset (https://golang.org/cl/3580)
  runtime, syscall: use SYSCALL instruction on FreeBSD (Go 1.5 now requires FreeBSD 8-STABLE+) (https://golang.org/cl/3020)
  strings: add Compare(x, y string) int, for symmetry with bytes.Compare (https://golang.org/cl/2828)
  testing/quick: support generation of arrays (https://golang.org/cl/3865)
@@@ -32,21 -34,3 +34,21 @@@ strconv: optimize decimal to string con
  math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560)
  math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480)
  
 +Assembler:
 +
 +ARM assembly syntax has had some features removed.
 +
 +      - mentioning SP or PC as a hardware register
 +              These are always pseudo-registers except that in some contexts
 +              they're not, and it's confusing because the context should not affect
 +              which register you mean. Change the references to the hardware
 +              registers to be explicit: R13 for SP, R15 for PC.
 +      - constant creation using assignment
 +              The files say a=b when they could instead say #define a b.
 +              There is no reason to have both mechanisms.
 +      - R(0) to refer to R0.
 +              Some macros use this to a great extent. Again, it's easy just to
 +              use a #define to rename a register.
 +      
 +Also expression evaluation now uses uint64s instead of signed integers and the
 +precedence of operators is now Go-like rather than C-like.
diff --combined src/cmd/dist/build.go
index 81249d4645b00a323d9342831bc1ce6d46744d0a,141d3c9660719f1e64f073db8da2e9507d0c3f81..e72b156190a98169ed2b0f911254c2925f823e7e
@@@ -36,7 -36,6 +36,7 @@@ var 
        oldgoarch        string
        oldgochar        string
        slash            string
 +      exe              string
        defaultcc        string
        defaultcflags    string
        defaultldflags   string
@@@ -297,6 -296,11 +297,11 @@@ func findgoversion() string 
                return chomp(readfile(path))
        }
  
+       // Show a nicer error message if this isn't a Git repo.
+       if !isGitRepo() {
+               fatal("FAILED: not a Git repo; must put a VERSION file in $GOROOT")
+       }
        // Otherwise, use Git.
        // What is the current branch?
        branch := chomp(run(goroot, CheckExit, "git", "rev-parse", "--abbrev-ref", "HEAD"))
        return tag
  }
  
+ // isGitRepo reports whether the working directory is inside a Git repository.
+ func isGitRepo() bool {
+       p := ".git"
+       for {
+               fi, err := os.Stat(p)
+               if os.IsNotExist(err) {
+                       p = filepath.Join("..", p)
+                       continue
+               }
+               if err != nil || !fi.IsDir() {
+                       return false
+               }
+               return true
+       }
+ }
  /*
   * Initial tree setup.
   */
@@@ -354,7 -374,6 +375,7 @@@ var oldtool = []string
  // not be in release branches.
  var unreleased = []string{
        "src/cmd/link",
 +      "src/cmd/objwriter",
        "src/debug/goobj",
        "src/old",
  }
@@@ -626,20 -645,13 +647,20 @@@ func install(dir string) 
                ldargs = splitfields(defaultldflags)
        }
  
 -      islib := strings.HasPrefix(dir, "lib") || dir == "cmd/gc" || dir == "cmd/ld"
 -      ispkg := !islib && !strings.HasPrefix(dir, "cmd/")
 -      isgo := ispkg || dir == "cmd/go" || dir == "cmd/cgo"
 +      isgo := true
 +      ispkg := !strings.HasPrefix(dir, "cmd/") || strings.HasPrefix(dir, "cmd/internal/") || strings.HasPrefix(dir, "cmd/asm/internal/")
 +      islib := false
  
 -      exe := ""
 -      if gohostos == "windows" {
 -              exe = ".exe"
 +      // Legacy C exceptions.
 +      switch dir {
 +      case "lib9", "libbio", "liblink", "cmd/gc", "cmd/ld":
 +              islib = true
 +              isgo = false
 +      case "cmd/5a", "cmd/5g", "cmd/5l",
 +              "cmd/6a", "cmd/6g", "cmd/6l",
 +              "cmd/8a", "cmd/8g", "cmd/8l",
 +              "cmd/9a", "cmd/9g", "cmd/9l":
 +              isgo = false
        }
  
        // Start final link command line.
                                compile = append(compile,
                                        "-D", fmt.Sprintf("GOOS=%q", goos),
                                        "-D", fmt.Sprintf("GOARCH=%q", goarch),
 +                                      "-D", fmt.Sprintf("GOHOSTOS=%q", gohostos),
 +                                      "-D", fmt.Sprintf("GOHOSTARCH=%q", gohostarch),
                                        "-D", fmt.Sprintf("GOROOT=%q", goroot_final),
                                        "-D", fmt.Sprintf("GOVERSION=%q", findgoversion()),
                                        "-D", fmt.Sprintf("GOARM=%q", goarm),
@@@ -1106,10 -1116,7 +1127,10 @@@ func dopack(dst, src string, extra []st
  }
  
  // buildorder records the order of builds for the 'go bootstrap' command.
 +// The Go packages and commands must be in dependency order,
 +// maintained by hand, but the order doesn't change often.
  var buildorder = []string{
 +      // Legacy C programs.
        "lib9",
        "libbio",
        "liblink",
        "cmd/%sa",
        "cmd/%sg",
  
 -      // The dependency order here was copied from a buildscript
 -      // back when there were build scripts.  Will have to
 -      // be maintained by hand, but shouldn't change very
 -      // often.
 +      // Go libraries and programs for bootstrap.
        "runtime",
        "errors",
        "sync/atomic",
        "reflect",
        "fmt",
        "encoding",
 +      "encoding/binary",
        "encoding/json",
        "flag",
        "path/filepath",
        "text/template",
        "go/doc",
        "go/build",
 +      "cmd/internal/obj",
 +      "cmd/internal/obj/arm",
 +      "cmd/internal/obj/i386",
 +      "cmd/internal/obj/ppc64",
 +      "cmd/internal/obj/x86",
 +      "cmd/objwriter",
        "cmd/go",
  }
  
@@@ -1364,8 -1367,6 +1385,8 @@@ func cmdbootstrap() 
  
        setup()
  
 +      bootstrapBuildTools()
 +
        // For the main bootstrap, building for host os/arch.
        oldgoos = goos
        oldgoarch = goarch
        os.Setenv("GOARCH", goarch)
        os.Setenv("GOOS", goos)
  
 +      // TODO(rsc): Enable when appropriate.
 +      // This step is only needed if we believe that the Go compiler built from Go 1.4
 +      // will produce different object files than the Go compiler built from itself.
 +      // In the absence of bugs, that should not happen.
 +      // And if there are bugs, they're more likely in the current development tree
 +      // than in a standard release like Go 1.4, so don't do this rebuild by default.
 +      if false {
 +              xprintf("##### Building Go toolchain using itself.\n")
 +              for _, pattern := range buildorder {
 +                      if pattern == "cmd/go" {
 +                              break
 +                      }
 +                      dir := pattern
 +                      if strings.Contains(pattern, "%s") {
 +                              dir = fmt.Sprintf(pattern, gohostchar)
 +                      }
 +                      install(dir)
 +                      if oldgochar != gohostchar && strings.Contains(pattern, "%s") {
 +                              install(fmt.Sprintf(pattern, oldgochar))
 +                      }
 +              }
 +              xprintf("\n")
 +      }
 +
 +      xprintf("##### Building compilers and go_bootstrap for host, %s/%s.\n", gohostos, gohostarch)
        for _, pattern := range buildorder {
                dir := pattern
                if strings.Contains(pattern, "%s") {
diff --combined src/cmd/dist/util.go
index df3e8154e2d6b6048dad4875516dfc89139fb032,f6f0b42e9eb9fb855a490eb25ba417e3f4c64205..12e14d3ae5054bfa8e8f3f7eb3be5c22f65954c1
@@@ -84,23 -84,8 +84,23 @@@ func run(dir string, mode int, cmd ...s
  
        xcmd := exec.Command(cmd[0], cmd[1:]...)
        xcmd.Dir = dir
 +      var data []byte
        var err error
 -      data, err := xcmd.CombinedOutput()
 +
 +      // If we want to show command output and this is not
 +      // a background command, assume it's the only thing
 +      // running, so we can just let it write directly stdout/stderr
 +      // as it runs without fear of mixing the output with some
 +      // other command's output. Not buffering lets the output
 +      // appear as it is printed instead of once the command exits.
 +      // This is most important for the invocation of 'go1.4 build -v bootstrap/...'.
 +      if mode&(Background|ShowOutput) == ShowOutput {
 +              xcmd.Stdout = os.Stdout
 +              xcmd.Stderr = os.Stderr
 +              err = xcmd.Run()
 +      } else {
 +              data, err = xcmd.CombinedOutput()
 +      }
        if err != nil && mode&CheckExit != 0 {
                outputLock.Lock()
                if len(data) > 0 {
@@@ -290,7 -275,7 +290,7 @@@ func xremoveall(p string) 
        os.RemoveAll(p)
  }
  
 -// xreaddir replaces dst with a list of the names of the files in dir.
 +// xreaddir replaces dst with a list of the names of the files and subdirectories in dir.
  // The names are relative to dir; they are not full paths.
  func xreaddir(dir string) []string {
        f, err := os.Open(dir)
        return names
  }
  
 +// xreaddir replaces dst with a list of the names of the files in dir.
 +// The names are relative to dir; they are not full paths.
 +func xreaddirfiles(dir string) []string {
 +      f, err := os.Open(dir)
 +      if err != nil {
 +              fatal("%v", err)
 +      }
 +      defer f.Close()
 +      infos, err := f.Readdir(-1)
 +      if err != nil {
 +              fatal("reading %s: %v", dir, err)
 +      }
 +      var names []string
 +      for _, fi := range infos {
 +              if !fi.IsDir() {
 +                      names = append(names, fi.Name())
 +              }
 +      }
 +      return names
 +}
 +
  // xworkdir creates a new temporary directory to hold object files
  // and returns the name of that directory.
  func xworkdir() string {
@@@ -406,15 -370,13 +406,15 @@@ func main() 
                if gohostarch == "" {
                        fatal("$objtype is unset")
                }
 +      case "windows":
 +              exe = ".exe"
        }
  
        sysinit()
  
        if gohostarch == "" {
                // Default Unix system.
-               out := run("", CheckExit, "uname", "-m", "-v")
+               out := run("", CheckExit, "uname", "-m")
                switch {
                case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"):
                        gohostarch = "amd64"
                case strings.Contains(out, "ppc64"):
                        gohostarch = "ppc64"
                case gohostos == "darwin":
-                       if strings.Contains(out, "RELEASE_ARM_") {
+                       if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM_") {
                                gohostarch = "arm"
                        }
                default: