gollvm: don't add golang.org packages to zstdpkglist.go

When emitting zstdpkglist.go, don't include golang.org/x
packages.

This is a port to cmake of the gofrontend makefile change at
https://go-review.googlesource.com/c/gofrontend/+/256319.

Updates golang/go#41368
Updates golang/go#41499

Change-Id: Ia6e73936104deb125410ba0c5db32cf3cfe8f9f2
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/256362
Trust: Than McIntosh <thanm@google.com>
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 a17b62a..38a74d5 100644
--- a/cmake/modules/AutoGenGo.cmake
+++ b/cmake/modules/AutoGenGo.cmake
@@ -304,7 +304,10 @@
   file(WRITE ${outfile} "package ${package}\n\n")
   file(APPEND ${outfile} "var stdpkg = map[string]bool{")
   foreach(pack ${libpackages})
-    file(APPEND ${outfile} "\"${pack}\": true,\n")
+    string(REGEX MATCH "^.*golang\.org\/.*$" matched ${pack})
+    if(NOT matched)
+      file(APPEND ${outfile} "\"${pack}\": true,\n")
+    endif()
   endforeach()
   file(APPEND ${outfile} "\"unsafe\": true,\n")
   file(APPEND ${outfile} "\"runtime/cgo\": true,\n")