Description: somehow upstream builds don't need these headers :-/
Forwarded: not-needed
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -37,6 +37,7 @@
 #include <inttypes.h>
 #include <stdio.h>
 
+#include <algorithm>
 #include <cctype>
 #include <iomanip>
 #include <memory>
--- a/libartbase/arch/instruction_set.cc
+++ b/libartbase/arch/instruction_set.cc
@@ -19,6 +19,7 @@
 #include "android-base/stringprintf.h"
 #include "base/bit_utils.h"
 #include "base/globals.h"
+#include <cstring>
 
 namespace art {
 
--- a/libartbase/base/arena_allocator.h
+++ b/libartbase/base/arena_allocator.h
@@ -17,6 +17,7 @@
 #ifndef ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_H_
 #define ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_H_
 
+#include <cstring>
 #include <stddef.h>
 #include <stdint.h>
 
--- a/libartbase/base/arena_containers.h
+++ b/libartbase/base/arena_containers.h
@@ -17,6 +17,7 @@
 #ifndef ART_LIBARTBASE_BASE_ARENA_CONTAINERS_H_
 #define ART_LIBARTBASE_BASE_ARENA_CONTAINERS_H_
 
+#include <cstring>
 #include <deque>
 #include <forward_list>
 #include <queue>
--- a/libartbase/base/bit_vector-inl.h
+++ b/libartbase/base/bit_vector-inl.h
@@ -20,6 +20,7 @@
 #include "bit_vector.h"
 
 #include <android-base/logging.h>
+#include <cstring>
 
 #include "bit_utils.h"
 
--- a/libartbase/base/bit_vector.h
+++ b/libartbase/base/bit_vector.h
@@ -18,7 +18,7 @@
 #define ART_LIBARTBASE_BASE_BIT_VECTOR_H_
 
 #include <stdint.h>
-
+#include <cstring>
 #include <iterator>
 
 #include "bit_utils.h"
--- a/libartbase/base/endian_utils.h
+++ b/libartbase/base/endian_utils.h
@@ -20,6 +20,7 @@
 #include <stdint.h>
 #include <endian.h>
 #include <vector>
+#include <cstring>
 
 namespace art {
 
--- a/libartbase/base/file_magic.cc
+++ b/libartbase/base/file_magic.cc
@@ -19,6 +19,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <cstring>
 
 #include <android-base/logging.h>
 #include <android-base/stringprintf.h>
--- a/libartbase/base/file_utils.cc
+++ b/libartbase/base/file_utils.cc
@@ -38,6 +38,7 @@
 #endif
 #endif
 
+#include <cstring>
 #include <memory>
 #include <sstream>
 #include <vector>
--- a/libartbase/base/histogram.h
+++ b/libartbase/base/histogram.h
@@ -20,6 +20,7 @@
 #include <vector>
 
 #include <android-base/macros.h>
+#include <stdint.h>
 
 namespace art {
 
--- a/libartbase/base/logging.cc
+++ b/libartbase/base/logging.cc
@@ -16,6 +16,7 @@
 
 #include "logging.h"
 
+#include <cstring>
 #include <iostream>
 #include <limits>
 #include <mutex>
--- a/libartbase/base/membarrier.cc
+++ b/libartbase/base/membarrier.cc
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <cstring>
 
 #if !defined(_WIN32)
 #include <sys/syscall.h>
--- a/libartbase/base/memfd.cc
+++ b/libartbase/base/memfd.cc
@@ -31,6 +31,7 @@
 #include <android-base/logging.h>
 #include <android-base/unique_fd.h>
 
+#include <cstring>
 #include "macros.h"
 
 
--- a/libartbase/base/metrics/metrics.h
+++ b/libartbase/base/metrics/metrics.h
@@ -19,6 +19,7 @@
 
 #include <stdint.h>
 
+#include <algorithm>
 #include <array>
 #include <atomic>
 #include <optional>
--- a/libartbase/base/scoped_flock.cc
+++ b/libartbase/base/scoped_flock.cc
@@ -19,6 +19,8 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 
+#include <cstring>
+
 #include <android-base/logging.h>
 #include <android-base/stringprintf.h>
 
--- a/libartbase/base/stl_util.h
+++ b/libartbase/base/stl_util.h
@@ -21,6 +21,7 @@
 #include <iterator>
 #include <set>
 #include <sstream>
+#include <optional>
 
 #include <android-base/logging.h>
 
--- a/libartbase/base/time_utils.h
+++ b/libartbase/base/time_utils.h
@@ -25,6 +25,7 @@
 
 #include <cstdint>
 #include <string>
+#include <limits>
 
 namespace art {
 
--- a/libartbase/base/unix_file/fd_file.cc
+++ b/libartbase/base/unix_file/fd_file.cc
@@ -29,6 +29,7 @@
 #include <windows.h>
 #endif
 
+#include <cstring>
 #include <limits>
 
 #include <android-base/file.h>
--- a/libdexfile/dex/compact_dex_file.cc
+++ b/libdexfile/dex/compact_dex_file.cc
@@ -16,6 +16,7 @@
 
 #include "compact_dex_file.h"
 
+#include <algorithm>
 #include <memory>
 
 #include "base/leb128.h"
--- a/libdexfile/dex/descriptors_names.cc
+++ b/libdexfile/dex/descriptors_names.cc
@@ -21,6 +21,7 @@
 
 #include "base/macros.h"
 #include "dex/utf-inl.h"
+#include <cstring>
 
 namespace art {
 
--- a/libdexfile/dex/dex_file_loader.h
+++ b/libdexfile/dex/dex_file_loader.h
@@ -27,6 +27,7 @@
 #include "base/os.h"
 #include "base/unix_file/fd_file.h"
 #include "dex_file.h"
+#include "string.h"
 
 namespace art {
 
--- a/libdexfile/dex/dex_file_types.h
+++ b/libdexfile/dex/dex_file_types.h
@@ -17,6 +17,7 @@
 #ifndef ART_LIBDEXFILE_DEX_DEX_FILE_TYPES_H_
 #define ART_LIBDEXFILE_DEX_DEX_FILE_TYPES_H_
 
+#include <cstdint>
 #include <functional>
 #include <iosfwd>
 #include <limits>
--- a/libdexfile/dex/method_reference.h
+++ b/libdexfile/dex/method_reference.h
@@ -17,6 +17,7 @@
 #ifndef ART_LIBDEXFILE_DEX_METHOD_REFERENCE_H_
 #define ART_LIBDEXFILE_DEX_METHOD_REFERENCE_H_
 
+#include <cstring>
 #include <stdint.h>
 #include <string>
 #include "dex/dex_file.h"
--- a/libdexfile/dex/standard_dex_file.cc
+++ b/libdexfile/dex/standard_dex_file.cc
@@ -16,6 +16,7 @@
 
 #include "standard_dex_file.h"
 
+#include <algorithm>
 #include "base/casts.h"
 #include "base/leb128.h"
 #include "code_item_accessors-inl.h"
--- a/libelffile/dwarf/writer.h
+++ b/libelffile/dwarf/writer.h
@@ -21,6 +21,7 @@
 #include <vector>
 
 #include <android-base/logging.h>
+#include <string.h>
 
 #include "base/bit_utils.h"
 #include "base/leb128.h"
--- a/libprofile/profile/profile_boot_info.cc
+++ b/libprofile/profile/profile_boot_info.cc
@@ -18,6 +18,8 @@
 
 #include <unistd.h>
 
+#include <algorithm>
+#include <cstring>
 #include <vector>
 
 #include "dex/dex_file.h"
--- a/runtime/app_info.h
+++ b/runtime/app_info.h
@@ -18,6 +18,7 @@
 #define ART_RUNTIME_APP_INFO_H_
 
 #include <vector>
+#include <optional>
 
 #include "base/mutex.h"
 #include <base/safe_map.h>
--- a/runtime/arch/context.h
+++ b/runtime/arch/context.h
@@ -19,6 +19,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
+#include <stdlib.h>
 
 #include "base/macros.h"
 
--- a/runtime/arch/x86/context_x86.cc
+++ b/runtime/arch/x86/context_x86.cc
@@ -16,6 +16,8 @@
 
 #include "context_x86.h"
 
+#include <cstring>
+
 #include "base/bit_utils.h"
 #include "base/bit_utils_iterator.h"
 #include "base/memory_tool.h"
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -18,6 +18,7 @@
 
 #include <errno.h>
 #include <sys/time.h>
+#include <algorithm>
 
 #include <sstream>
 
--- a/runtime/entrypoints/jni/jni_entrypoints.cc
+++ b/runtime/entrypoints/jni/jni_entrypoints.cc
@@ -16,6 +16,7 @@
 
 #include <android-base/logging.h>
 
+#include <algorithm>
 #include "arch/arm/jni_frame_arm.h"
 #include "arch/arm64/jni_frame_arm64.h"
 #include "arch/instruction_set.h"
--- a/runtime/exec_utils.cc
+++ b/runtime/exec_utils.cc
@@ -20,6 +20,7 @@
 #include <string>
 #include <thread>
 #include <vector>
+#include <cstring>
 
 #include "android-base/file.h"
 #include "android-base/parseint.h"
--- a/runtime/gc/accounting/heap_bitmap.cc
+++ b/runtime/gc/accounting/heap_bitmap.cc
@@ -16,6 +16,8 @@
 
 #include "heap_bitmap.h"
 
+#include <algorithm>
+
 #include "gc/accounting/space_bitmap-inl.h"
 #include "gc/space/space.h"
 
--- a/runtime/gc/accounting/read_barrier_table.h
+++ b/runtime/gc/accounting/read_barrier_table.h
@@ -18,6 +18,7 @@
 #define ART_RUNTIME_GC_ACCOUNTING_READ_BARRIER_TABLE_H_
 
 #include <sys/mman.h>  // For the PROT_* and MAP_* constants.
+#include <cstring>
 
 #include "base/bit_utils.h"
 #include "base/locks.h"
--- a/runtime/jit/profiling_info.h
+++ b/runtime/jit/profiling_info.h
@@ -18,6 +18,7 @@
 #define ART_RUNTIME_JIT_PROFILING_INFO_H_
 
 #include <vector>
+#include <cstring>
 
 #include "base/macros.h"
 #include "base/value_object.h"
--- a/runtime/monitor.h
+++ b/runtime/monitor.h
@@ -25,6 +25,7 @@
 #include <iosfwd>
 #include <list>
 #include <vector>
+#include <cstring>
 
 #include "base/allocator.h"
 #include "base/atomic.h"
--- a/runtime/runtime_common.h
+++ b/runtime/runtime_common.h
@@ -27,6 +27,7 @@
 
 #include <sys/utsname.h>
 #include <ucontext.h>
+#include <signal.h>
 
 #include <iomanip>
 
--- a/runtime/runtime_options.h
+++ b/runtime/runtime_options.h
@@ -21,6 +21,7 @@
 #include <cstdio>
 #include <string>
 #include <vector>
+#include <optional>
 
 #include "arch/instruction_set.h"
 #include "base/variant_map.h"
--- a/runtime/transaction.h
+++ b/runtime/transaction.h
@@ -29,6 +29,7 @@
 
 #include <list>
 #include <map>
+#include <optional>
 
 namespace art {
 namespace gc {
--- a/sigchainlib/sigchain.cc
+++ b/sigchainlib/sigchain.cc
@@ -31,6 +31,7 @@
 #include <mutex>
 #include <type_traits>
 #include <utility>
+#include <climits>
 
 #include "log.h"
 #include "sigchain.h"
