blob: 135fba982cdd7cc4bc10a6d3fd7a2cb982ad3606 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001diff --git a/absl/base/attributes.h b/absl/base/attributes.h
2index d4f67a12..e10f3957 100644
3--- a/absl/base/attributes.h
4+++ b/absl/base/attributes.h
5@@ -196,7 +196,7 @@
6 //
7 // Tells the compiler that a given function never returns.
8 #if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__))
9-#define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn))
10+#define ABSL_ATTRIBUTE_NORETURN [[noreturn]]
11 #elif defined(_MSC_VER)
12 #define ABSL_ATTRIBUTE_NORETURN __declspec(noreturn)
13 #else
James Kuszmaul203bfc22023-01-13 22:37:06 -080014diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
Austin Schuh99f7c6a2024-06-25 22:07:44 -070015index 430916f7..ebc876f2 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -080016--- a/absl/copts/GENERATED_AbseilCopts.cmake
17+++ b/absl/copts/GENERATED_AbseilCopts.cmake
James Kuszmaul9776b392023-01-14 14:08:08 -080018@@ -49,6 +49,13 @@ list(APPEND ABSL_GCC_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080019 "-Wundef"
20 "-Wunused-local-typedefs"
21 "-Wunused-result"
22+ "-Wno-format-nonliteral"
23+ "-Wno-tautological-type-limit-compare"
24+ "-Wno-unused-parameter"
25+ "-Wno-sign-conversion"
26+ "-Wno-shorten-64-to-32"
27+ "-Wno-shadow"
James Kuszmaul9776b392023-01-14 14:08:08 -080028+ "-Wno-stringop-overflow"
James Kuszmaul203bfc22023-01-13 22:37:06 -080029 "-Wvarargs"
30 "-Wvla"
31 "-Wwrite-strings"
James Kuszmaul9776b392023-01-14 14:08:08 -080032@@ -66,6 +73,13 @@ list(APPEND ABSL_GCC_TEST_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080033 "-Wundef"
34 "-Wunused-local-typedefs"
35 "-Wunused-result"
36+ "-Wno-format-nonliteral"
37+ "-Wno-tautological-type-limit-compare"
38+ "-Wno-unused-parameter"
39+ "-Wno-sign-conversion"
40+ "-Wno-shorten-64-to-32"
41+ "-Wno-shadow"
James Kuszmaul9776b392023-01-14 14:08:08 -080042+ "-Wno-stringop-overflow"
James Kuszmaul203bfc22023-01-13 22:37:06 -080043 "-Wvarargs"
44 "-Wvla"
45 "-Wwrite-strings"
Austin Schuh99f7c6a2024-06-25 22:07:44 -070046@@ -96,8 +110,8 @@ list(APPEND ABSL_LLVM_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080047 "-Woverlength-strings"
48 "-Wpointer-arith"
49 "-Wself-assign"
50- "-Wshadow-all"
51 "-Wshorten-64-to-32"
52+ "-Wno-shadow"
53 "-Wsign-conversion"
54 "-Wstring-conversion"
55 "-Wtautological-overlap-compare"
Austin Schuh99f7c6a2024-06-25 22:07:44 -070056@@ -115,6 +129,12 @@ list(APPEND ABSL_LLVM_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080057 "-Wno-implicit-int-float-conversion"
58 "-Wno-unknown-warning-option"
59 "-DNOMINMAX"
60+ "-Wno-format-nonliteral"
61+ "-Wno-unused-parameter"
62+ "-Wno-tautological-type-limit-compare"
63+ "-Wno-sign-conversion"
64+ "-Wno-shorten-64-to-32"
James Kuszmaul9776b392023-01-14 14:08:08 -080065+ "-Wno-stringop-overflow"
James Kuszmaul203bfc22023-01-13 22:37:06 -080066 )
Austin Schuh99f7c6a2024-06-25 22:07:44 -070067
James Kuszmaul203bfc22023-01-13 22:37:06 -080068 list(APPEND ABSL_LLVM_TEST_FLAGS
Austin Schuh99f7c6a2024-06-25 22:07:44 -070069@@ -134,7 +154,7 @@ list(APPEND ABSL_LLVM_TEST_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080070 "-Woverlength-strings"
71 "-Wpointer-arith"
72 "-Wself-assign"
73- "-Wshadow-all"
74+ "-Wno-shadow"
75 "-Wstring-conversion"
76 "-Wtautological-overlap-compare"
77 "-Wtautological-unsigned-zero-compare"
Austin Schuh99f7c6a2024-06-25 22:07:44 -070078@@ -151,6 +171,12 @@ list(APPEND ABSL_LLVM_TEST_FLAGS
James Kuszmaul203bfc22023-01-13 22:37:06 -080079 "-Wno-implicit-int-float-conversion"
80 "-Wno-unknown-warning-option"
81 "-DNOMINMAX"
82+ "-Wno-format-nonliteral"
83+ "-Wno-unused-parameter"
84+ "-Wno-tautological-type-limit-compare"
85+ "-Wno-sign-conversion"
86+ "-Wno-shorten-64-to-32"
James Kuszmaul9776b392023-01-14 14:08:08 -080087+ "-Wno-stringop-overflow"
James Kuszmaul203bfc22023-01-13 22:37:06 -080088 "-Wno-deprecated-declarations"
89 "-Wno-implicit-int-conversion"
90 "-Wno-missing-prototypes"
91diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
Austin Schuh99f7c6a2024-06-25 22:07:44 -070092index 011d8a98..beb94fa7 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -080093--- a/absl/copts/GENERATED_copts.bzl
94+++ b/absl/copts/GENERATED_copts.bzl
James Kuszmaul9776b392023-01-14 14:08:08 -080095@@ -50,6 +50,13 @@ ABSL_GCC_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -080096 "-Wundef",
97 "-Wunused-local-typedefs",
98 "-Wunused-result",
99+ "-Wno-format-nonliteral",
100+ "-Wno-tautological-type-limit-compare",
101+ "-Wno-unused-parameter",
102+ "-Wno-sign-conversion",
103+ "-Wno-shorten-64-to-32",
104+ "-Wno-shadow",
James Kuszmaul9776b392023-01-14 14:08:08 -0800105+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800106 "-Wvarargs",
107 "-Wvla",
108 "-Wwrite-strings",
James Kuszmaul9776b392023-01-14 14:08:08 -0800109@@ -67,6 +74,13 @@ ABSL_GCC_TEST_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800110 "-Wundef",
111 "-Wunused-local-typedefs",
112 "-Wunused-result",
113+ "-Wno-format-nonliteral",
114+ "-Wno-tautological-type-limit-compare",
115+ "-Wno-unused-parameter",
116+ "-Wno-sign-conversion",
117+ "-Wno-shorten-64-to-32",
118+ "-Wno-shadow",
James Kuszmaul9776b392023-01-14 14:08:08 -0800119+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800120 "-Wvarargs",
121 "-Wvla",
122 "-Wwrite-strings",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700123@@ -97,8 +111,8 @@ ABSL_LLVM_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800124 "-Woverlength-strings",
125 "-Wpointer-arith",
126 "-Wself-assign",
127- "-Wshadow-all",
128 "-Wshorten-64-to-32",
129+ "-Wno-shadow",
130 "-Wsign-conversion",
131 "-Wstring-conversion",
132 "-Wtautological-overlap-compare",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700133@@ -116,6 +130,12 @@ ABSL_LLVM_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800134 "-Wno-implicit-int-float-conversion",
135 "-Wno-unknown-warning-option",
136 "-DNOMINMAX",
137+ "-Wno-format-nonliteral",
138+ "-Wno-unused-parameter",
139+ "-Wno-tautological-type-limit-compare",
140+ "-Wno-sign-conversion",
141+ "-Wno-shorten-64-to-32",
James Kuszmaul9776b392023-01-14 14:08:08 -0800142+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800143 ]
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700144
James Kuszmaul203bfc22023-01-13 22:37:06 -0800145 ABSL_LLVM_TEST_FLAGS = [
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700146@@ -135,7 +155,7 @@ ABSL_LLVM_TEST_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800147 "-Woverlength-strings",
148 "-Wpointer-arith",
149 "-Wself-assign",
150- "-Wshadow-all",
151+ "-Wno-shadow",
152 "-Wstring-conversion",
153 "-Wtautological-overlap-compare",
154 "-Wtautological-unsigned-zero-compare",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700155@@ -152,6 +172,12 @@ ABSL_LLVM_TEST_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800156 "-Wno-implicit-int-float-conversion",
157 "-Wno-unknown-warning-option",
158 "-DNOMINMAX",
159+ "-Wno-format-nonliteral",
160+ "-Wno-unused-parameter",
161+ "-Wno-tautological-type-limit-compare",
162+ "-Wno-sign-conversion",
163+ "-Wno-shorten-64-to-32",
James Kuszmaul9776b392023-01-14 14:08:08 -0800164+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800165 "-Wno-deprecated-declarations",
166 "-Wno-implicit-int-conversion",
167 "-Wno-missing-prototypes",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700168diff --git a/absl/copts/configure_copts.bzl b/absl/copts/configure_copts.bzl
169index ca5f26da..d9303c6b 100644
170--- a/absl/copts/configure_copts.bzl
171+++ b/absl/copts/configure_copts.bzl
172@@ -46,13 +46,8 @@ ABSL_DEFAULT_LINKOPTS = select({
173 # environment to build an accelerated RandenHwAes library.
174 ABSL_RANDOM_RANDEN_COPTS = select({
175 # APPLE
176- ":cpu_darwin_x86_64": ABSL_RANDOM_HWAES_X64_FLAGS,
177- ":cpu_darwin": ABSL_RANDOM_HWAES_X64_FLAGS,
178- ":cpu_x64_windows_msvc": ABSL_RANDOM_HWAES_MSVC_X64_FLAGS,
179- ":cpu_x64_windows": ABSL_RANDOM_HWAES_MSVC_X64_FLAGS,
180- ":cpu_k8": ABSL_RANDOM_HWAES_X64_FLAGS,
181- ":cpu_ppc": ["-mcrypto"],
182- ":cpu_aarch64": ABSL_RANDOM_HWAES_ARM64_FLAGS,
183+ "@platforms//cpu:x86_64": ABSL_RANDOM_HWAES_X64_FLAGS,
184+ "@platforms//cpu:aarch64": ABSL_RANDOM_HWAES_ARM64_FLAGS,
185
186 # Supported by default or unsupported.
187 "//conditions:default": [],
James Kuszmaul203bfc22023-01-13 22:37:06 -0800188diff --git a/absl/copts/copts.py b/absl/copts/copts.py
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700189index e6e11949..ea3e9e9a 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -0800190--- a/absl/copts/copts.py
191+++ b/absl/copts/copts.py
James Kuszmaul9776b392023-01-14 14:08:08 -0800192@@ -23,6 +23,13 @@ ABSL_GCC_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800193 "-Wundef",
194 "-Wunused-local-typedefs",
195 "-Wunused-result",
196+ "-Wno-format-nonliteral",
197+ "-Wno-tautological-type-limit-compare",
198+ "-Wno-unused-parameter",
199+ "-Wno-sign-conversion",
200+ "-Wno-shorten-64-to-32",
201+ "-Wno-shadow",
James Kuszmaul9776b392023-01-14 14:08:08 -0800202+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800203 "-Wvarargs",
204 "-Wvla", # variable-length array
205 "-Wwrite-strings",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700206@@ -57,8 +64,8 @@ ABSL_LLVM_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800207 "-Woverlength-strings",
208 "-Wpointer-arith",
209 "-Wself-assign",
210- "-Wshadow-all",
211 "-Wshorten-64-to-32",
212+ "-Wno-shadow",
213 "-Wsign-conversion",
214 "-Wstring-conversion",
215 "-Wtautological-overlap-compare",
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700216@@ -81,6 +88,12 @@ ABSL_LLVM_FLAGS = [
James Kuszmaul203bfc22023-01-13 22:37:06 -0800217 "-Wno-unknown-warning-option",
218 # Don't define min and max macros (Build on Windows using clang)
219 "-DNOMINMAX",
220+ "-Wno-format-nonliteral",
221+ "-Wno-unused-parameter",
222+ "-Wno-tautological-type-limit-compare",
223+ "-Wno-sign-conversion",
224+ "-Wno-shorten-64-to-32",
James Kuszmaul9776b392023-01-14 14:08:08 -0800225+ "-Wno-stringop-overflow",
James Kuszmaul203bfc22023-01-13 22:37:06 -0800226 ]
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700227
James Kuszmaul203bfc22023-01-13 22:37:06 -0800228 ABSL_LLVM_TEST_ADDITIONAL_FLAGS = [
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700229diff --git a/absl/log/internal/check_op.cc b/absl/log/internal/check_op.cc
230index f4b67647..09d65386 100644
231--- a/absl/log/internal/check_op.cc
232+++ b/absl/log/internal/check_op.cc
233@@ -28,6 +28,17 @@
234 #include "absl/base/config.h"
235 #include "absl/strings/str_cat.h"
236
237+namespace aos {
238+void FatalUnsetRealtimePriority() __attribute__((weak));
239+}
240+
241+static void MaybeUnsetRealtime() {
242+ if (&aos::FatalUnsetRealtimePriority != nullptr) {
243+ aos::FatalUnsetRealtimePriority();
244+ }
245+}
246+
247+
248 namespace absl {
249 ABSL_NAMESPACE_BEGIN
250 namespace log_internal {
251@@ -50,6 +61,7 @@ ABSL_LOGGING_INTERNAL_DEFINE_MAKE_CHECK_OP_STRING(const void*);
252 #undef ABSL_LOGGING_INTERNAL_DEFINE_MAKE_CHECK_OP_STRING
253
254 CheckOpMessageBuilder::CheckOpMessageBuilder(const char* exprtext) {
255+ MaybeUnsetRealtime();
256 stream_ << exprtext << " (";
257 }
258
259diff --git a/absl/log/internal/log_message.cc b/absl/log/internal/log_message.cc
260index 10ac2453..30a4909c 100644
261--- a/absl/log/internal/log_message.cc
262+++ b/absl/log/internal/log_message.cc
263@@ -60,6 +60,16 @@ extern "C" ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(
264 // Default - Do nothing
265 }
266
267+namespace aos {
268+void FatalUnsetRealtimePriority() __attribute__((weak));
269+}
270+
271+static void MaybeUnsetRealtime() {
272+ if (&aos::FatalUnsetRealtimePriority != nullptr) {
273+ aos::FatalUnsetRealtimePriority();
274+ }
275+}
276+
277 namespace absl {
278 ABSL_NAMESPACE_BEGIN
279 namespace log_internal {
280@@ -215,15 +225,21 @@ void LogMessage::LogMessageData::FinalizeEncodingAndFormat() {
281 }
282 auto chars_written =
283 static_cast<size_t>(string_remaining.data() - string_buf.data());
284- string_buf[chars_written++] = '\n';
285+ string_buf[chars_written++] = '\n';
286 string_buf[chars_written++] = '\0';
287 entry.text_message_with_prefix_and_newline_and_nul_ =
288 absl::MakeSpan(string_buf).subspan(0, chars_written);
289 }
290
291 LogMessage::LogMessage(const char* file, int line, absl::LogSeverity severity)
292- : data_(absl::make_unique<LogMessageData>(file, line, severity,
293- absl::Now())) {
294+ : data_([&]() {
295+ if (severity == absl::LogSeverity::kFatal &&
296+ absl::log_internal::ExitOnDFatal()) {
297+ MaybeUnsetRealtime();
298+ }
299+ return absl::make_unique<LogMessageData>(file, line, severity,
300+ absl::Now());
301+ }()) {
302 data_->first_fatal = false;
303 data_->is_perror = false;
304 data_->fail_quietly = false;
James Kuszmaul203bfc22023-01-13 22:37:06 -0800305diff --git a/absl/random/internal/BUILD.bazel b/absl/random/internal/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700306index 71a742ee..4809b2d0 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -0800307--- a/absl/random/internal/BUILD.bazel
308+++ b/absl/random/internal/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700309@@ -692,6 +692,7 @@ cc_test(
James Kuszmaul203bfc22023-01-13 22:37:06 -0800310 cc_library(
311 name = "nanobenchmark",
312 srcs = ["nanobenchmark.cc"],
313+ copts = ABSL_DEFAULT_COPTS,
314 linkopts = ABSL_DEFAULT_LINKOPTS,
315 textual_hdrs = ["nanobenchmark.h"],
316 deps = [
317diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700318index 8e8371b3..b34d1487 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -0800319--- a/absl/strings/BUILD.bazel
320+++ b/absl/strings/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700321@@ -788,6 +788,7 @@ cc_test(
James Kuszmaul203bfc22023-01-13 22:37:06 -0800322 srcs = [
323 "internal/cordz_info_statistics_test.cc",
324 ],
325+ copts = ABSL_DEFAULT_COPTS,
326 deps = [
327 ":cord",
328 ":cord_internal",
329diff --git a/absl/time/internal/cctz/BUILD.bazel b/absl/time/internal/cctz/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700330index 0b43bb12..920c8b9c 100644
James Kuszmaul203bfc22023-01-13 22:37:06 -0800331--- a/absl/time/internal/cctz/BUILD.bazel
332+++ b/absl/time/internal/cctz/BUILD.bazel
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700333@@ -20,6 +20,13 @@ package(features = [
334
James Kuszmaul203bfc22023-01-13 22:37:06 -0800335 licenses(["notice"])
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700336
James Kuszmaul203bfc22023-01-13 22:37:06 -0800337+load(
338+ "//absl:copts/configure_copts.bzl",
339+ "ABSL_DEFAULT_COPTS",
340+ "ABSL_DEFAULT_LINKOPTS",
341+ "ABSL_TEST_COPTS",
342+)
343+
344 ### libraries
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700345
James Kuszmaul203bfc22023-01-13 22:37:06 -0800346 cc_library(
Austin Schuh99f7c6a2024-06-25 22:07:44 -0700347@@ -28,6 +35,8 @@ cc_library(
James Kuszmaul203bfc22023-01-13 22:37:06 -0800348 hdrs = [
349 "include/cctz/civil_time.h",
350 ],
351+ copts = ABSL_DEFAULT_COPTS,
352+ linkopts = ABSL_DEFAULT_LINKOPTS,
353 textual_hdrs = ["include/cctz/civil_time_detail.h"],
354 visibility = ["//visibility:public"],
355 deps = ["//absl/base:config"],