gollvm: update FAQ with material on required C/C++ version
Users who build gollvm with older versions of Clang (prior to
5.0) may run into undefined "__get_cpuid_count" symbols at
runtime, due to a not-completely-functional copy of <cpuid.h>
provided by these older compilers.
To help with this, add a section to the instructions on building Gollvm
that calls out the required C/C++ compiler vintage, and add an
item to the FAQ that describes the symptom if an older Clang
is used for the build.
Change-Id: I59f17cc69161e1baf03e7c74926f534d76480290
Reviewed-on: https://go-review.googlesource.com/c/154347
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/README.md b/README.md
index 8992df7..a2cd96b 100644
--- a/README.md
+++ b/README.md
@@ -62,9 +62,9 @@
%
```
-## Building gollvm with cmake and ninja <a name="cmakeninja"></a>
+## Building gollvm with cmake and ninja <a name="cmakeninja"></a>
-You'll need to have an up-to-date copy of cmake on your system (3.6 or later vintage) to build Gollvm.
+You'll need to have an up-to-date copy of cmake on your system (3.6 or later vintage) to build Gollvm, as well as a C/C++ compiler (V5.0 or later for Clang, or V4.9 or later of GCC).
Create a build directory (separate from the source tree) and run 'cmake' within the build area to set up for the build. Assuming that 'workarea' is the directory created as above:
@@ -79,7 +79,7 @@
%
```
-This will build the various tools and libraries needed for Gollvm.
+This will build the various tools and libraries needed for Gollvm. To select a specific C/C++ compiler for the build, you can use the "-DCMAKE_C_COMPILER" and "-DCMAKE_CXX_COMPILER" options to select your desired C/C++ compiler when invoking cmake (details [here](https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-do-i-use-a-different-compiler)).
## Installing gollvm <a name="installing"></a>
@@ -336,3 +336,7 @@
## Can I use the race detector? <a name="racedetector"></a>
Gollvm does not support the Go race detector; please use the main Go compiler for this purpose.
+
+## I am seeing "undefined symbol: `__get_cpuid_count`" from my gollvm install <a name="getcpuidcount_undefined">
+
+The Gollvm build procedure requires an up-to-date C/C++ compiler; there is code in the gollvm runtime (libgo) that refers to functions defined in `<cpuid.h>`, however some older versions of clang (prior to 5.0) don't provide definitions for all the needed functions. If you encounter this problem, rerun `cmake` to configure your build to use a more recent version of Clang (or use GCC), as described above.