Home | History | Annotate | Download | only in compile
      1 // Copyright 2015 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 package main
      6 
      7 import (
      8 	"cmd/compile/internal/amd64"
      9 	"cmd/compile/internal/arm"
     10 	"cmd/compile/internal/arm64"
     11 	"cmd/compile/internal/gc"
     12 	"cmd/compile/internal/mips"
     13 	"cmd/compile/internal/mips64"
     14 	"cmd/compile/internal/ppc64"
     15 	"cmd/compile/internal/s390x"
     16 	"cmd/compile/internal/x86"
     17 	"cmd/internal/obj"
     18 	"fmt"
     19 	"log"
     20 	"os"
     21 )
     22 
     23 func main() {
     24 	// disable timestamps for reproducible output
     25 	log.SetFlags(0)
     26 	log.SetPrefix("compile: ")
     27 
     28 	switch obj.GOARCH {
     29 	default:
     30 		fmt.Fprintf(os.Stderr, "compile: unknown architecture %q\n", obj.GOARCH)
     31 		os.Exit(2)
     32 	case "386":
     33 		x86.Init()
     34 	case "amd64", "amd64p32":
     35 		amd64.Init()
     36 	case "arm":
     37 		arm.Init()
     38 	case "arm64":
     39 		arm64.Init()
     40 	case "mips", "mipsle":
     41 		mips.Init()
     42 	case "mips64", "mips64le":
     43 		mips64.Init()
     44 	case "ppc64", "ppc64le":
     45 		ppc64.Init()
     46 	case "s390x":
     47 		s390x.Init()
     48 	}
     49 
     50 	gc.Main()
     51 	gc.Exit(0)
     52 }
     53