Add symlink installation support

Allow modules to specify a list of names to create alias symlinks, and
pass the list to make so it can create them.  Also pass
LOCAL_FORCE_STATIC_EXECUTABLE for static binaries so that make can avoid
a linker_asan -> linker -> linker_asan dependency loop.

Change-Id: I314d088095ac5f43641ed2cf8247c14c27e23b93
diff --git a/android/module.go b/android/module.go
index a00cb7d..ef20f8d 100644
--- a/android/module.go
+++ b/android/module.go
@@ -78,6 +78,7 @@
 
 	InstallFile(installPath OutputPath, srcPath Path, deps ...Path) OutputPath
 	InstallFileName(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath
+	InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath
 	CheckbuildFile(srcPath Path)
 
 	AddMissingDependencies(deps []string)
@@ -563,6 +564,24 @@
 	return a.InstallFileName(installPath, filepath.Base(srcPath.String()), srcPath, deps...)
 }
 
+func (a *androidModuleContext) InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath {
+	fullInstallPath := installPath.Join(a, name)
+
+	a.ModuleBuild(pctx, ModuleBuildParams{
+		Rule:      Symlink,
+		Output:    fullInstallPath,
+		OrderOnly: Paths{srcPath},
+		Default:   !a.AConfig().EmbeddedInMake(),
+		Args: map[string]string{
+			"fromPath": srcPath.String(),
+		},
+	})
+
+	a.installFiles = append(a.installFiles, fullInstallPath)
+	a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
+	return fullInstallPath
+}
+
 func (a *androidModuleContext) CheckbuildFile(srcPath Path) {
 	a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
 }