Merge "Convert android_app and android_test's module-info.json to soong" into main
diff --git a/aconfig/Android.bp b/aconfig/Android.bp
index 1505ba5..3484b97 100644
--- a/aconfig/Android.bp
+++ b/aconfig/Android.bp
@@ -29,12 +29,17 @@
     pluginFor: ["soong_build"],
 }
 
+// All FlaggedApi flags associated with platform API.
+// By default this uses the platform APIs associated with android.jar
+// but other verticals/platforms can override via soong config setting.
 all_aconfig_declarations {
     name: "all_aconfig_declarations",
-    api_files: [
-        ":frameworks-base-api-current.txt",
-        ":frameworks-base-api-system-current.txt",
-        ":frameworks-base-api-system-server-current.txt",
-        ":frameworks-base-api-module-lib-current.txt",
-    ],
+    api_files: select(soong_config_variable("android_aconfig", "opt_platform_api_srcs"), {
+        default: [
+            ":frameworks-base-api-current.txt",
+            ":frameworks-base-api-system-current.txt",
+            ":frameworks-base-api-system-server-current.txt",
+            ":frameworks-base-api-module-lib-current.txt",
+        ],
+    }),
 }
diff --git a/cc/config/global.go b/cc/config/global.go
index a309dc0..4407967 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -292,7 +292,6 @@
 		"-Wno-error=deprecated",          // in external/googletest/googletest
 		// New warnings to be fixed after clang-r522817
 		"-Wno-error=invalid-offsetof",
-		"-Wno-error=thread-safety-reference-return",
 
 		// Allow using VLA CXX extension.
 		"-Wno-vla-cxx-extension",
diff --git a/rust/rust.go b/rust/rust.go
index 6428859..5e9b7af 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -1767,6 +1767,7 @@
 	depPaths.depClangFlags = android.FirstUniqueStrings(depPaths.depClangFlags)
 	depPaths.depIncludePaths = android.FirstUniquePaths(depPaths.depIncludePaths)
 	depPaths.depSystemIncludePaths = android.FirstUniquePaths(depPaths.depSystemIncludePaths)
+	depPaths.depLinkFlags = android.FirstUniqueStrings(depPaths.depLinkFlags)
 
 	return depPaths
 }