rust: Rust sanitized snapshots variations
This adds support for correctly handling Rust sanitized snapshots,
ensuring they only have one variation.
The presence of multiple variations were causing build failures
when a rust_fuzz module for host was defined and a snapshot
build was requested.
This also sets -Z link-native-libraries=no on host modules
(in addition to device modules) to avoid emitting extra linkage
flags due to link attributes.
Bug: 282897366
Test: SOONG_SDK_SNAPSHOT_USE_SRCJAR=true m
Change-Id: Idf980c29145f11c530ad635a4eb5b01a1730ac24
diff --git a/cc/linkable.go b/cc/linkable.go
index 2099399..5b5b856 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -95,6 +95,18 @@
// IsSnapshotPrebuilt returns true if this module is a snapshot prebuilt.
IsSnapshotPrebuilt() bool
+
+ // IsSnapshotSanitizer returns true if this snapshot module implements SnapshotSanitizer.
+ IsSnapshotSanitizer() bool
+
+ // IsSnapshotSanitizerAvailable returns true if this snapshot module has a sanitizer source available (cfi, hwasan).
+ IsSnapshotSanitizerAvailable(t SanitizerType) bool
+
+ // SetSnapshotSanitizerVariation sets the sanitizer variation type for this snapshot module.
+ SetSnapshotSanitizerVariation(t SanitizerType, enabled bool)
+
+ // IsSnapshotUnsanitizedVariant returns true if this is the unsanitized snapshot module variant.
+ IsSnapshotUnsanitizedVariant() bool
}
// LinkableInterface is an interface for a type of module that is linkable in a C++ library.