gollvm: cmake changes to sync with Go 1.13

Cmake updates to bring gollvm into sync with the Go 1.13 version
of libgo.

Change-Id: I94c7541e3528bd191609b86b86d080eb40a901e6
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/193479
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/cmake/modules/AutoGenGo.cmake b/cmake/modules/AutoGenGo.cmake
index 741118ab..e51643d 100644
--- a/cmake/modules/AutoGenGo.cmake
+++ b/cmake/modules/AutoGenGo.cmake
@@ -25,7 +25,7 @@
   # as part of the original build.
 
   # Tools subdir within the install.
-  file(APPEND ${outfile} "func init() { DefaultGoroot = \"${CMAKE_INSTALL_PREFIX}\" }\n")
+  file(APPEND ${outfile} "func defaultGOROOTValue() string { return \"${CMAKE_INSTALL_PREFIX}\" }\n")
 
   # Compiler version
   file(STRINGS "${srcroot}/../VERSION" rawver)
@@ -53,7 +53,6 @@
     set(physpagesize "4096")
     set(pcquantum "1")
     set(int64align "8")
-    set(hugepagesize "1 << 21")
     set(minframesize 0)
   endif()
 
@@ -80,7 +79,7 @@
   endforeach()
   file(APPEND ${outfile} "\n")
 
-  set(constants "ArchFamily:family" "BigEndian:bigendian" "CacheLineSize:cachelinesize" "PhysPageSize:defaultphyspagesize" "PCQuantum:pcquantum" "Int64Align:int64align" "HugePageSize:hugepagesize" "MinFrameSize:minframesize")
+  set(constants "ArchFamily:family" "BigEndian:bigendian" "CacheLineSize:cachelinesize" "PhysPageSize:defaultphyspagesize" "PCQuantum:pcquantum" "Int64Align:int64align" "MinFrameSize:minframesize")
 
   file(APPEND ${outfile} "const (\n")
   foreach(item ${constants})
@@ -234,15 +233,17 @@
   file(WRITE ${outfile} "package objabi\n\n")
   file(APPEND ${outfile} "import \"runtime\"\n")
 
-  file(APPEND ${outfile} "func init() { defaultGOROOT = \"${GOLLVM_INSTALL_DIR}\" }\n")
+  file(APPEND ${outfile} "func defaultGOROOTValue() string { return \"${GOLLVM_INSTALL_DIR}\" }\n")
 
   file(APPEND ${outfile} "const defaultGO386 = `sse2`\n")
   file(APPEND ${outfile} "const defaultGOARM = `5`\n")
   file(APPEND ${outfile} "const defaultGOMIPS = `hardfloat`\n")
   file(APPEND ${outfile} "const defaultGOMIPS64 = `hardfloat`\n")
   file(APPEND ${outfile} "const defaultGOOS = runtime.GOOS\n")
+  file(APPEND ${outfile} "const defaultGOPPC64 = `power8`\n")
   file(APPEND ${outfile} "const defaultGOARCH = runtime.GOARCH\n")
   file(APPEND ${outfile} "const defaultGO_EXTLINK_ENABLED = ``\n")
+  file(APPEND ${outfile} "const defaultGO_LDSO = ``\n")
   file(APPEND ${outfile} "const version = ")
   emitversionstring(${outfile} ${srcroot})
   file(APPEND ${outfile} "\n")
diff --git a/libgo/CMakeLists.txt b/libgo/CMakeLists.txt
index e28cc61..0a442eb 100644
--- a/libgo/CMakeLists.txt
+++ b/libgo/CMakeLists.txt
@@ -429,6 +429,7 @@
   "go/log/syslog/syslog_c.c"
   "go/reflect/makefunc_ffi_c.c"
   "go/runtime/internal/atomic/atomic.c"
+  "go/golang.org/x/sys/cpu/cpu_gccgo.c"
   "go/internal/cpu/cpu_gccgo.c"
   "go/sync/atomic/atomic.c"
   "go/syscall/errno.c"