cmd/gomobile: use correct version of clang on windows/386

Fixes golang/go#16823
Fixes golang/go#17376

Change-Id: Ia9c15242cce66eca1d36a5e1dc6106b3549c251d
Reviewed-on: https://go-review.googlesource.com/31110
Reviewed-by: Elias Naur <elias.naur@gmail.com>
diff --git a/cmd/gomobile/init.go b/cmd/gomobile/init.go
index 67aa647..769d61e 100644
--- a/cmd/gomobile/init.go
+++ b/cmd/gomobile/init.go
@@ -451,11 +451,20 @@
 				return err
 			}
 		}
-		for _, name := range []string{"clang", "clang++"} {
+		for _, toname := range []string{"clang", "clang++"} {
+			fromname := toname
 			if goos == "windows" {
-				name += ".exe"
+				if goarch == "386" {
+					if toname == "clang++" {
+						// there is no 32-bit version of clang++
+						continue
+					}
+					fromname += "_32"
+				}
+				fromname += ".exe"
+				toname += ".exe"
 			}
-			if err := symlink(filepath.Join(llvmdst, "bin", name), filepath.Join(dst, "bin", toolchain.toolPrefix+"-"+name)); err != nil {
+			if err := symlink(filepath.Join(llvmdst, "bin", fromname), filepath.Join(dst, "bin", toolchain.toolPrefix+"-"+toname)); err != nil {
 				return err
 			}
 		}