Merge "Add a malloc rss benchmark"
diff --git a/libc/Android.bp b/libc/Android.bp
index cd53906..e1803b8 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -2260,6 +2260,37 @@
 }
 
 // ========================================================
+// libc dependencies for baremetal Rust projects.
+// ========================================================
+
+cc_defaults {
+    name: "librust_baremetal_defaults",
+    header_libs: ["libc_headers"],
+    include_dirs: [
+        "bionic/libc/async_safe/include",
+        "bionic/libc/platform",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+    ],
+    system_shared_libs: [],
+    nocrt: true,
+    stl: "none",
+}
+
+cc_library_static {
+    name: "librust_baremetal",
+    defaults: ["librust_baremetal_defaults"],
+    whole_static_libs: [
+        "libarm-optimized-routines-mem",
+    ],
+    visibility: [
+        "//packages/modules/Virtualization/vmbase",
+    ],
+}
+
+// ========================================================
 // NDK headers.
 // ========================================================
 
diff --git a/libc/include/libgen.h b/libc/include/libgen.h
index b910790..474f066 100644
--- a/libc/include/libgen.h
+++ b/libc/include/libgen.h
@@ -50,7 +50,7 @@
  * Note that Android's cv-qualifiers differ from POSIX; Android's implementation doesn't
  * modify its input and uses thread-local storage for the result if necessary.
  */
-char* __posix_basename(const char* __path) __RENAME(basename);
+char* _Nullable __posix_basename(const char* _Nullable __path) __RENAME(basename);
 
 /**
  * This macro ensures that callers get the POSIX basename() if they include this header,
@@ -65,13 +65,13 @@
  * Note that Android's cv-qualifiers differ from POSIX; Android's implementation doesn't
  * modify its input and uses thread-local storage for the result if necessary.
  */
-char* dirname(const char* __path);
+char* _Nullable dirname(const char* _Nullable __path);
 
 #if !defined(__LP64__)
 /** Deprecated. Use dirname() instead. */
-int dirname_r(const char* __path, char* __buf, size_t __n);
+int dirname_r(const char* _Nullable __path, char* _Nullable __buf, size_t __n);
 /** Deprecated. Use basename() instead. */
-int basename_r(const char* __path, char* __buf, size_t __n);
+int basename_r(const char* _Nullable __path, char* _Nullable __buf, size_t __n);
 #endif
 
 __END_DECLS