[absl] Explicitly use hardened versions of various absl classes.

The absl implementations contain various hardening checks that are
sometimes undefined behavior as defined by the standard, and thus, as
implemented by STL. Force the use of absl's internal implementations to
ensure these hardening checks are not lost.

Bug: 817982, 1257145
Change-Id: Icd61e4c30ca32f622240329f73e3b826ea071b24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3208208
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929865}
NOKEYCHECK=True
GitOrigin-RevId: d593291ca3a1eb728b00d6f6b5706d3aa12de503
diff --git a/absl/base/options.h b/absl/base/options.h
index df506f0..1641271 100644
--- a/absl/base/options.h
+++ b/absl/base/options.h
@@ -100,7 +100,7 @@
 // User code should not inspect this macro.  To check in the preprocessor if
 // absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY.
 
-#define ABSL_OPTION_USE_STD_ANY 2
+#define ABSL_OPTION_USE_STD_ANY 0
 
 
 // ABSL_OPTION_USE_STD_OPTIONAL
@@ -127,7 +127,7 @@
 // absl::optional is a typedef of std::optional, use the feature macro
 // ABSL_USES_STD_OPTIONAL.
 
-#define ABSL_OPTION_USE_STD_OPTIONAL 2
+#define ABSL_OPTION_USE_STD_OPTIONAL 0
 
 
 // ABSL_OPTION_USE_STD_STRING_VIEW
@@ -154,7 +154,7 @@
 // absl::string_view is a typedef of std::string_view, use the feature macro
 // ABSL_USES_STD_STRING_VIEW.
 
-#define ABSL_OPTION_USE_STD_STRING_VIEW 2
+#define ABSL_OPTION_USE_STD_STRING_VIEW 0
 
 // ABSL_OPTION_USE_STD_VARIANT
 //
@@ -180,7 +180,7 @@
 // absl::variant is a typedef of std::variant, use the feature macro
 // ABSL_USES_STD_VARIANT.
 
-#define ABSL_OPTION_USE_STD_VARIANT 2
+#define ABSL_OPTION_USE_STD_VARIANT 0
 
 
 // ABSL_OPTION_USE_INLINE_NAMESPACE
diff --git a/patches/0001-Turn-on-hardened-mode.patch b/patches/0001-Turn-on-hardened-mode.patch
index 7fb0c83..6881a08 100644
--- a/patches/0001-Turn-on-hardened-mode.patch
+++ b/patches/0001-Turn-on-hardened-mode.patch
@@ -1,16 +1,55 @@
-From a2df3397d72987acaf6687a55e5ed58cd68b0158 Mon Sep 17 00:00:00 2001
-From: Mirko Bonadei <mbonadei@chromium.org>
-Date: Fri, 17 Apr 2020 14:21:07 +0200
-Subject: [PATCH] Turn on hardened mode.
+From 15f51edf989cc47588c3d8635a62c255cdeb0072 Mon Sep 17 00:00:00 2001
+From: Daniel Cheng <dcheng@chromium.org>
+Date: Wed, 6 Oct 2021 03:23:23 -0700
+Subject: [PATCH] Turn on hardened mode and alias absl types to STL types..
 
+The absl implementations contain various hardening checks that are
+sometimes simply UB as defined by the standard, and thus, as
+implemented by STL.
 ---
- third_party/abseil-cpp/absl/base/options.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ third_party/abseil-cpp/absl/base/options.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/third_party/abseil-cpp/absl/base/options.h b/third_party/abseil-cpp/absl/base/options.h
-index 230bf1eecc4a..df506f0fae64 100644
+index 230bf1eecc4a4..1641271cd3ff9 100644
 --- a/third_party/abseil-cpp/absl/base/options.h
 +++ b/third_party/abseil-cpp/absl/base/options.h
+@@ -100,7 +100,7 @@
+ // User code should not inspect this macro.  To check in the preprocessor if
+ // absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY.
+ 
+-#define ABSL_OPTION_USE_STD_ANY 2
++#define ABSL_OPTION_USE_STD_ANY 0
+ 
+ 
+ // ABSL_OPTION_USE_STD_OPTIONAL
+@@ -127,7 +127,7 @@
+ // absl::optional is a typedef of std::optional, use the feature macro
+ // ABSL_USES_STD_OPTIONAL.
+ 
+-#define ABSL_OPTION_USE_STD_OPTIONAL 2
++#define ABSL_OPTION_USE_STD_OPTIONAL 0
+ 
+ 
+ // ABSL_OPTION_USE_STD_STRING_VIEW
+@@ -154,7 +154,7 @@
+ // absl::string_view is a typedef of std::string_view, use the feature macro
+ // ABSL_USES_STD_STRING_VIEW.
+ 
+-#define ABSL_OPTION_USE_STD_STRING_VIEW 2
++#define ABSL_OPTION_USE_STD_STRING_VIEW 0
+ 
+ // ABSL_OPTION_USE_STD_VARIANT
+ //
+@@ -180,7 +180,7 @@
+ // absl::variant is a typedef of std::variant, use the feature macro
+ // ABSL_USES_STD_VARIANT.
+ 
+-#define ABSL_OPTION_USE_STD_VARIANT 2
++#define ABSL_OPTION_USE_STD_VARIANT 0
+ 
+ 
+ // ABSL_OPTION_USE_INLINE_NAMESPACE
 @@ -233,6 +233,6 @@
  // checks enabled by this option may abort the program in a different way and
  // log additional information when `NDEBUG` is not defined.
@@ -20,5 +59,5 @@
  
  #endif  // ABSL_BASE_OPTIONS_H_
 -- 
-2.26.0.110.g2183baf09c-goog
+2.33.0.882.g93a45727a2-goog