Supporting changes for CFI toolchain features
Mostly exporting variables to Bazel, but also allowlisting a BUILD
file.
Bug: 251217226
Test: Unit tests
Change-Id: Id87015a3cd5d970700c4058ec989bb0c14c36bcb
diff --git a/cc/linker.go b/cc/linker.go
index e49b97d..257fe86 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -15,11 +15,12 @@
package cc
import (
- "android/soong/android"
- "android/soong/cc/config"
"fmt"
"path/filepath"
+ "android/soong/android"
+ "android/soong/cc/config"
+
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -542,13 +543,13 @@
ctx.PropertyErrorf("version_script", "Not supported on Darwin")
} else {
flags.Local.LdFlags = append(flags.Local.LdFlags,
- "-Wl,--version-script,"+versionScript.String())
+ config.VersionScriptFlagPrefix+versionScript.String())
flags.LdFlagsDeps = append(flags.LdFlagsDeps, versionScript.Path())
if linker.sanitize.isSanitizerEnabled(cfi) {
- cfiExportsMap := android.PathForSource(ctx, cfiExportsMapPath)
+ cfiExportsMap := android.PathForSource(ctx, cfiExportsMapPath+"/"+cfiExportsMapFilename)
flags.Local.LdFlags = append(flags.Local.LdFlags,
- "-Wl,--version-script,"+cfiExportsMap.String())
+ config.VersionScriptFlagPrefix+cfiExportsMap.String())
flags.LdFlagsDeps = append(flags.LdFlagsDeps, cfiExportsMap)
}
}