gollvm: add GOLLVM_EXTRA_CFLAGS cmake option

Just like GOLLVM_EXTRA_GOCFLAGS, accept GOLLVM_EXTRA_CFLAGS
and pass it to the C part of libgo compilation.

While here, also fix a buglet in passing C flags: basedefines
is a list, directly appending to string results in a string
without spaces between each piece. Use a loop instead.

Change-Id: I7b914f3f8f82189e6174ba7dd85d38e6597bd071
Reviewed-on: https://go-review.googlesource.com/119156
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/libgo/CMakeLists.txt b/libgo/CMakeLists.txt
index 6a9b8cb..53c1cd4 100644
--- a/libgo/CMakeLists.txt
+++ b/libgo/CMakeLists.txt
@@ -443,7 +443,10 @@
 
 # Compiler flags for C files in the runtime.
 set(baseopts "-Wno-zero-length-array -fsplit-stack ")
-string(APPEND baseopts ${basedefines})
+foreach(def ${basedefines})
+  string(APPEND baseopts "${def} ")
+endforeach()
+string(APPEND baseopts "${GOLLVM_EXTRA_CFLAGS} ")
 
 # Object library based on libgo C code, PIC-compiled
 add_library(libgo_c_piclib OBJECT EXCLUDE_FROM_ALL ${runtimecpaths})