Fix data race on cfiExportsMap

cfiExportsMap was reinitialized for every module, which caused
data races.  Create the path from the string on each use
instead.

Bug: 77234104
Test: m nothing with race detector turned on
Change-Id: Ibca3149dcbe8a9d4d9f7ec6dd0b164697e7ae5cd
diff --git a/cc/library.go b/cc/library.go
index bac566f..76f8a8c 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -532,6 +532,7 @@
 			flags.LdFlags = append(flags.LdFlags, "-Wl,--version-script,"+versionScript.String())
 			linkerDeps = append(linkerDeps, versionScript.Path())
 			if library.sanitize.isSanitizerEnabled(cfi) {
+				cfiExportsMap := android.PathForSource(ctx, cfiExportsMapPath)
 				flags.LdFlags = append(flags.LdFlags, "-Wl,--version-script,"+cfiExportsMap.String())
 				linkerDeps = append(linkerDeps, cfiExportsMap)
 			}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 981d92c..c9fcafc 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -39,7 +39,6 @@
 	cfiLdflags = []string{"-flto", "-fsanitize-cfi-cross-dso", "-fsanitize=cfi",
 		"-Wl,-plugin-opt,O1"}
 	cfiExportsMapPath  = "build/soong/cc/config/cfi_exports.map"
-	cfiExportsMap      android.Path
 	cfiStaticLibsMutex sync.Mutex
 
 	intOverflowCflags   = []string{"-fsanitize-blacklist=build/soong/cc/config/integer_overflow_blacklist.txt"}
@@ -284,8 +283,6 @@
 			ctx.ModuleErrorf(`Use of "coverage" also requires "address"`)
 		}
 	}
-
-	cfiExportsMap = android.PathForSource(ctx, cfiExportsMapPath)
 }
 
 func (sanitize *sanitize) deps(ctx BaseModuleContext, deps Deps) Deps {