Make sure that ASAN runtime lib is the first DT_NEEDED one
Introduce a new tag earlySharedDepTag which is added in front of the
ordinary sharedDep dependencies. Dependency to the ASAN runtime lib is
added with the new tag.
Bug: 120894259
Bug: 121038155
Test: m; SANITIZE_TARGET=address m
Use readelf -d to see if the runtime lib is in the first DT_NEEDED one.
Change-Id: I90de6ab95df734a99995532d826564b13fe05316
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 0951efe..90656da 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -809,7 +809,7 @@
mctx.AddFarVariationDependencies([]blueprint.Variation{
{Mutator: "link", Variation: "shared"},
{Mutator: "arch", Variation: mctx.Target().String()},
- }, sharedDepTag, runtimeLibrary)
+ }, earlySharedDepTag, runtimeLibrary)
}
// static lib does not have dependency to the runtime library. The
// dependency will be added to the executables or shared libs using