@@ -206,9 +206,24 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
206206 provides ("golang@:1.4" , when = "@5:" )
207207 provides ("golang@:1.6.1" , when = "@6:" )
208208 provides ("golang@:1.8" , when = "@7:" )
209+ provides ("golang@:1.10" , when = "@8:" )
210+ provides ("golang@:1.12" , when = "@9:" )
211+ provides ("golang@:1.14" , when = "@10:" )
212+ provides ("golang@:1.16" , when = "@11:" )
213+ provides ("golang@:1.18" , when = "@11:" )
209214 # GCC 4.6 added support for the Go programming language.
210215 # See https://gcc.gnu.org/gcc-4.6/changes.html
211216 conflicts ("@:4.5" , msg = "support for Go has been added in GCC 4.6" )
217+ # aarch64 machines (including Macs with Apple silicon) can't use
218+ # go-bootstrap because it pre-dates aarch64 support in Go. When not
219+ # using an external go bootstrap go, These machines have to rely on
220+ # Go support in gcc (which may require compiling a version of gcc
221+ # with Go support just to satisfy this requirement). However,
222+ # there's also a bug in some versions of GCC's Go front-end that prevents
223+ # these versions from properly bootstrapping Go. (See issue #47771
224+ # https://github.com/golang/go/issues/47771 ) On the 10.x branch, we need
225+ # at least 10.4. On the 11.x branch, we need at least 11.3:
226+ provides ("go-external-or-gccgo-bootstrap" , when = "gcc@10.4.0:10,11.3.0:target=aarch64:" )
212227 # Go is not supported on macOS
213228 conflicts ("platform=darwin" , msg = "Go not supported on MacOS" )
214229
@@ -442,7 +457,7 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
442457
443458 @classproperty
444459 def executables (cls ):
445- names = [r"gcc" , r"[^\w]?g\+\+" , r"gfortran" , r"gdc" ]
460+ names = [r"gcc" , r"[^\w]?g\+\+" , r"gfortran" , r"gdc" , r"gccgo" ]
446461 suffixes = [r"" , r"-mp-\d+\.\d" , r"-\d+\.\d" , r"-\d+" , r"\d\d" ]
447462 return [r"" .join (x ) for x in itertools .product (names , suffixes )]
448463
@@ -520,6 +535,9 @@ def determine_variants(cls, exes, version_str):
520535 elif "gcc" in basename :
521536 languages .add ("c" )
522537 compilers ["c" ] = exe
538+ elif "gccgo" in basename :
539+ languages .add ("go" )
540+ compilers ["go" ] = exe
523541 elif "gdc" in basename :
524542 languages .add ("d" )
525543 compilers ["d" ] = exe
0 commit comments