0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-06-05 08:11:16 +00:00
Files
2025-05-12 15:06:25 +08:00

509 lines
19 KiB
Diff

From 956b314cc369d901087fc50074139bb811c92cad Mon Sep 17 00:00:00 2001
From: Chongyun Lee <licy183@termux.dev>
Date: Thu, 17 Apr 2025 03:17:35 +0800
Subject: [PATCH] reland jumbo 5
Enable jumbo build for the following component(s)/source_set(s):
# - //third_party/boringssl:boringssl # Too much to patch
- //third_party/inspector_protocol:crdtp
- //third_party/leveldatabase:leveldatabase
- //net/third_party/quiche:quiche
---
quiche/http2/core/spdy_framer.cc | 4 ++++
quiche/http2/core/spdy_protocol.cc | 4 ++++
quiche/quic/core/congestion_control/bbr2_sender.cc | 4 ++++
quiche/quic/core/congestion_control/bbr_sender.cc | 4 ++++
.../quic/core/congestion_control/tcp_cubic_sender_bytes.cc | 4 ++++
quiche/quic/core/crypto/aead_base_decrypter.cc | 4 ++--
quiche/quic/core/crypto/aead_base_encrypter.cc | 4 ++--
quiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc | 6 ++++++
quiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc | 6 ++++++
quiche/quic/core/crypto/aes_128_gcm_decrypter.cc | 6 ++++++
quiche/quic/core/crypto/aes_128_gcm_encrypter.cc | 6 ++++++
quiche/quic/core/crypto/aes_256_gcm_decrypter.cc | 6 ++++++
quiche/quic/core/crypto/aes_256_gcm_encrypter.cc | 6 ++++++
quiche/quic/core/crypto/chacha20_poly1305_decrypter.cc | 6 ++++++
quiche/quic/core/crypto/chacha20_poly1305_encrypter.cc | 6 ++++++
quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc | 6 ++++++
quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc | 6 ++++++
quiche/quic/core/crypto/crypto_secret_boxer.cc | 4 ++++
quiche/quic/core/http/web_transport_http3.cc | 2 ++
quiche/quic/core/quic_stream.cc | 2 ++
quiche/quic/core/quic_stream_id_manager.cc | 2 ++
quiche/quic/core/tls_handshaker.cc | 2 ++
22 files changed, 96 insertions(+), 4 deletions(-)
---
net/third_party/quiche/BUILD.gn | 3 ++-
third_party/inspector_protocol/BUILD.gn | 4 +++-
third_party/leveldatabase/BUILD.gn | 3 ++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/third_party/quiche/BUILD.gn b/net/third_party/quiche/BUILD.gn
index 93911f4559..72cc38fa78 100644
--- a/net/third_party/quiche/BUILD.gn
+++ b/net/third_party/quiche/BUILD.gn
@@ -25,6 +25,7 @@
# (*) only used on platforms where epoll tests are built
import("//build/config/chromeos/ui_mode.gni")
+import("//build/config/jumbo.gni")
import("//net/third_party/quiche/src/build/source_list.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/protobuf/proto_library.gni")
@@ -48,7 +49,7 @@ config("quiche_config") {
]
}
-component("quiche") {
+jumbo_component("quiche") {
# TODO(crbug.com/325102878): Remove once usage of the deprecated version of
# absl::HexStringToBytes have been removed.
cflags = [ "-Wno-deprecated-declarations" ]
diff --git a/quiche/http2/core/spdy_framer.cc b/quiche/http2/core/spdy_framer.cc
index 897e253..c32d2ae 100644
--- a/net/third_party/quiche/src/quiche/http2/core/spdy_framer.cc
+++ b/net/third_party/quiche/src/quiche/http2/core/spdy_framer.cc
@@ -41,6 +41,8 @@ uint32_t PackStreamDependencyValues(bool exclusive,
// Used to indicate no flags in a HTTP2 flags field.
const uint8_t kNoFlags = 0;
+#define kPadLengthFieldSize kPadLengthFieldSize_SpdyFramer
+
// Wire size of pad length field.
const size_t kPadLengthFieldSize = 1;
@@ -1368,3 +1370,5 @@ size_t SpdyFramer::header_encoder_table_size() const {
}
} // namespace spdy
+
+#undef kPadLengthFieldSize
diff --git a/quiche/http2/core/spdy_protocol.cc b/quiche/http2/core/spdy_protocol.cc
index ae3f662..b4254a1 100644
--- a/net/third_party/quiche/src/quiche/http2/core/spdy_protocol.cc
+++ b/net/third_party/quiche/src/quiche/http2/core/spdy_protocol.cc
@@ -20,6 +20,8 @@
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/spdy/core/http2_header_block.h"
+#define kPadLengthFieldSize kPadLengthFieldSize_SpdyProtocol
+
namespace spdy {
const char* const kHttp2ConnectionHeaderPrefix =
@@ -631,3 +633,5 @@ size_t GetPushPromiseFrameSizeSansBlock(
}
} // namespace spdy
+
+#undef kPadLengthFieldSize
diff --git a/quiche/quic/core/congestion_control/bbr2_sender.cc b/quiche/quic/core/congestion_control/bbr2_sender.cc
index be7f132..a6aa315 100644
--- a/net/third_party/quiche/src/quiche/quic/core/congestion_control/bbr2_sender.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/congestion_control/bbr2_sender.cc
@@ -23,6 +23,8 @@
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/common/print_elements.h"
+#define kDefaultMinimumCongestionWindow kDefaultMinimumCongestionWindow_BBR2
+
namespace quic {
namespace {
@@ -581,3 +583,5 @@ std::ostream& operator<<(std::ostream& os, const Bbr2Sender::DebugState& s) {
}
} // namespace quic
+
+#undef kDefaultMinimumCongestionWindow
diff --git a/quiche/quic/core/congestion_control/bbr_sender.cc b/quiche/quic/core/congestion_control/bbr_sender.cc
index 34bb068..01ca5ab 100644
--- a/net/third_party/quiche/src/quiche/quic/core/congestion_control/bbr_sender.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/congestion_control/bbr_sender.cc
@@ -19,6 +19,8 @@
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
+#define kDefaultMinimumCongestionWindow kDefaultMinimumCongestionWindow_BBR
+
namespace quic {
namespace {
@@ -895,3 +897,5 @@ std::ostream& operator<<(std::ostream& os, const BbrSender::DebugState& state) {
}
} // namespace quic
+
+#undef kDefaultMinimumCongestionWindow
diff --git a/quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.cc b/quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
index 610bce7..6a0ad1c 100644
--- a/net/third_party/quiche/src/quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.cc
@@ -16,6 +16,8 @@
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
+#define kDefaultMinimumCongestionWindow kDefaultMinimumCongestionWindow_CUBIC
+
namespace quic {
namespace {
@@ -385,3 +387,5 @@ CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const {
}
} // namespace quic
+
+#undef kDefaultMinimumCongestionWindow
diff --git a/quiche/quic/core/crypto/aead_base_decrypter.cc b/quiche/quic/core/crypto/aead_base_decrypter.cc
index b6a3c4f..3535338 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aead_base_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aead_base_decrypter.cc
@@ -22,7 +22,7 @@ using ::quiche::ClearOpenSslErrors;
using ::quiche::DLogOpenSslErrors;
namespace {
-const EVP_AEAD* InitAndCall(const EVP_AEAD* (*aead_getter)()) {
+const EVP_AEAD* InitAndCallDec(const EVP_AEAD* (*aead_getter)()) {
// Ensure BoringSSL is initialized before calling |aead_getter|. In Chromium,
// the static initializer is disabled.
CRYPTO_library_init();
@@ -35,7 +35,7 @@ AeadBaseDecrypter::AeadBaseDecrypter(const EVP_AEAD* (*aead_getter)(),
size_t key_size, size_t auth_tag_size,
size_t nonce_size,
bool use_ietf_nonce_construction)
- : aead_alg_(InitAndCall(aead_getter)),
+ : aead_alg_(InitAndCallDec(aead_getter)),
key_size_(key_size),
auth_tag_size_(auth_tag_size),
nonce_size_(nonce_size),
diff --git a/quiche/quic/core/crypto/aead_base_encrypter.cc b/quiche/quic/core/crypto/aead_base_encrypter.cc
index 928343f..ffa3935 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aead_base_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aead_base_encrypter.cc
@@ -20,7 +20,7 @@ namespace quic {
using ::quiche::DLogOpenSslErrors;
namespace {
-const EVP_AEAD* InitAndCall(const EVP_AEAD* (*aead_getter)()) {
+const EVP_AEAD* InitAndCallEnc(const EVP_AEAD* (*aead_getter)()) {
// Ensure BoringSSL is initialized before calling |aead_getter|. In Chromium,
// the static initializer is disabled.
CRYPTO_library_init();
@@ -33,7 +33,7 @@ AeadBaseEncrypter::AeadBaseEncrypter(const EVP_AEAD* (*aead_getter)(),
size_t key_size, size_t auth_tag_size,
size_t nonce_size,
bool use_ietf_nonce_construction)
- : aead_alg_(InitAndCall(aead_getter)),
+ : aead_alg_(InitAndCallEnc(aead_getter)),
key_size_(key_size),
auth_tag_size_(auth_tag_size),
nonce_size_(nonce_size),
diff --git a/quiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc b/quiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc
index 66f2ad2..9b564c0 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_decrypter.cc
@@ -7,6 +7,9 @@
#include "openssl/aead.h"
#include "openssl/tls1.h"
+#define kKeySize kKeySize_AES128GCM12Dec
+#define kNonceSize kNonceSize_AES128GCM12Dec
+
namespace quic {
namespace {
@@ -30,3 +33,6 @@ uint32_t Aes128Gcm12Decrypter::cipher_id() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc b/quiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc
index 5bbaeba..db6cb51 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_encrypter.cc
@@ -6,6 +6,9 @@
#include "openssl/evp.h"
+#define kKeySize kKeySize_AES128GCM12Enc
+#define kNonceSize kNonceSize_AES128GCM12Enc
+
namespace quic {
namespace {
@@ -25,3 +28,6 @@ Aes128Gcm12Encrypter::Aes128Gcm12Encrypter()
Aes128Gcm12Encrypter::~Aes128Gcm12Encrypter() {}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/aes_128_gcm_decrypter.cc b/quiche/quic/core/crypto/aes_128_gcm_decrypter.cc
index c43123b..d63d6ab 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_decrypter.cc
@@ -9,6 +9,9 @@
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
+#define kKeySize kKeySize_AES128GCMDec
+#define kNonceSize kNonceSize_AES128GCMDec
+
namespace quic {
namespace {
@@ -32,3 +35,6 @@ uint32_t Aes128GcmDecrypter::cipher_id() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/aes_128_gcm_encrypter.cc b/quiche/quic/core/crypto/aes_128_gcm_encrypter.cc
index 22f9b2a..ccc4691 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_encrypter.cc
@@ -6,6 +6,9 @@
#include "openssl/evp.h"
+#define kKeySize kKeySize_AES128GCMEnc
+#define kNonceSize kNonceSize_AES128GCMEnc
+
namespace quic {
namespace {
@@ -25,3 +28,6 @@ Aes128GcmEncrypter::Aes128GcmEncrypter()
Aes128GcmEncrypter::~Aes128GcmEncrypter() {}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/aes_256_gcm_decrypter.cc b/quiche/quic/core/crypto/aes_256_gcm_decrypter.cc
index 58d4e3c..37c62a1 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_256_gcm_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_256_gcm_decrypter.cc
@@ -9,6 +9,9 @@
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
+#define kKeySize kKeySize_AES256GCMDec
+#define kNonceSize kNonceSize_AES256GCMDec
+
namespace quic {
namespace {
@@ -32,3 +35,6 @@ uint32_t Aes256GcmDecrypter::cipher_id() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/aes_256_gcm_encrypter.cc b/quiche/quic/core/crypto/aes_256_gcm_encrypter.cc
index 802ff99..08ec945 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/aes_256_gcm_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/aes_256_gcm_encrypter.cc
@@ -6,6 +6,9 @@
#include "openssl/evp.h"
+#define kKeySize kKeySize_AES256GCMEnc
+#define kNonceSize kNonceSize_AES256GCMEnc
+
namespace quic {
namespace {
@@ -25,3 +28,6 @@ Aes256GcmEncrypter::Aes256GcmEncrypter()
Aes256GcmEncrypter::~Aes256GcmEncrypter() {}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/chacha20_poly1305_decrypter.cc b/quiche/quic/core/crypto/chacha20_poly1305_decrypter.cc
index 31758b4..9454c45 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_decrypter.cc
@@ -7,6 +7,9 @@
#include "openssl/aead.h"
#include "openssl/tls1.h"
+#define kKeySize kKeySize_ChaCha20Poly1305Dec
+#define kNonceSize kNonceSize_ChaCha20Poly1305Dec
+
namespace quic {
namespace {
@@ -39,3 +42,6 @@ QuicPacketCount ChaCha20Poly1305Decrypter::GetIntegrityLimit() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/chacha20_poly1305_encrypter.cc b/quiche/quic/core/crypto/chacha20_poly1305_encrypter.cc
index f259dea..80fea5d 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_encrypter.cc
@@ -8,6 +8,9 @@
#include "openssl/evp.h"
+#define kKeySize kKeySize_ChaCha20Poly1305Enc
+#define kNonceSize kNonceSize_ChaCha20Poly1305Enc
+
namespace quic {
namespace {
@@ -35,3 +38,6 @@ QuicPacketCount ChaCha20Poly1305Encrypter::GetConfidentialityLimit() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc b/quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
index 93b0993..887bf46 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
@@ -9,6 +9,9 @@
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
+#define kKeySize kKeySize_ChaCha20Poly1305TLSDec
+#define kNonceSize kNonceSize_ChaCha20Poly1305TLSDec
+
namespace quic {
namespace {
@@ -41,3 +44,6 @@ QuicPacketCount ChaCha20Poly1305TlsDecrypter::GetIntegrityLimit() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc b/quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
index 0d7c69b..5923d71 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
@@ -8,6 +8,9 @@
#include "openssl/evp.h"
+#define kKeySize kKeySize_ChaCha20Poly1305TLSEnc
+#define kNonceSize kNonceSize_ChaCha20Poly1305TLSEnc
+
namespace quic {
namespace {
@@ -35,3 +38,6 @@ QuicPacketCount ChaCha20Poly1305TlsEncrypter::GetConfidentialityLimit() const {
}
} // namespace quic
+
+#undef kKeySize
+#undef kNonceSize
diff --git a/quiche/quic/core/crypto/crypto_secret_boxer.cc b/quiche/quic/core/crypto/crypto_secret_boxer.cc
index 6860bec..03a835c 100644
--- a/net/third_party/quiche/src/quiche/quic/core/crypto/crypto_secret_boxer.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/crypto/crypto_secret_boxer.cc
@@ -16,6 +16,8 @@
#include "quiche/quic/core/crypto/quic_random.h"
#include "quiche/quic/platform/api/quic_logging.h"
+#define kAEAD kAEAD_CryptoSecretBoxer
+
namespace quic {
// kSIVNonceSize contains the number of bytes of nonce in each AES-GCM-SIV box.
@@ -147,3 +149,5 @@ bool CryptoSecretBoxer::Unbox(absl::string_view in_ciphertext,
}
} // namespace quic
+
+#undef kAEAD
diff --git a/quiche/quic/core/http/web_transport_http3.cc b/quiche/quic/core/http/web_transport_http3.cc
index d0687ee..e348b85 100644
--- a/net/third_party/quiche/src/quiche/quic/core/http/web_transport_http3.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/http/web_transport_http3.cc
@@ -474,3 +474,5 @@ uint64_t WebTransportErrorToHttp3(
}
} // namespace quic
+
+#undef ENDPOINT
diff --git a/quiche/quic/core/quic_stream.cc b/quiche/quic/core/quic_stream.cc
index e927ee2..87469a4 100644
--- a/net/third_party/quiche/src/quiche/quic/core/quic_stream.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/quic_stream.cc
@@ -1448,3 +1448,5 @@ QuicByteCount QuicStream::CalculateSendWindowSize() const {
}
} // namespace quic
+
+#undef ENDPOINT
diff --git a/quiche/quic/core/quic_stream_id_manager.cc b/quiche/quic/core/quic_stream_id_manager.cc
index 0129bea..e3f0d88 100644
--- a/net/third_party/quiche/src/quiche/quic/core/quic_stream_id_manager.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/quic_stream_id_manager.cc
@@ -244,3 +244,5 @@ QuicStreamCount QuicStreamIdManager::available_incoming_streams() const {
}
} // namespace quic
+
+#undef ENDPOINT
diff --git a/quiche/quic/core/tls_handshaker.cc b/quiche/quic/core/tls_handshaker.cc
index ff9bfe5..a3464aa 100644
--- a/net/third_party/quiche/src/quiche/quic/core/tls_handshaker.cc
+++ b/net/third_party/quiche/src/quiche/quic/core/tls_handshaker.cc
@@ -423,3 +423,5 @@ void TlsHandshaker::MessageCallback(bool is_write, int /*version*/,
}
} // namespace quic
+
+#undef ENDPOINT
diff --git a/third_party/inspector_protocol/BUILD.gn b/third_party/inspector_protocol/BUILD.gn
index 646e0cf929..6131bb2509 100644
--- a/third_party/inspector_protocol/BUILD.gn
+++ b/third_party/inspector_protocol/BUILD.gn
@@ -2,7 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-component("crdtp") {
+import("//build/config/jumbo.gni")
+
+jumbo_component("crdtp") {
sources = [
"crdtp/cbor.cc",
"crdtp/cbor.h",
diff --git a/third_party/leveldatabase/BUILD.gn b/third_party/leveldatabase/BUILD.gn
index db16e21024..dbf02f0dee 100644
--- a/third_party/leveldatabase/BUILD.gn
+++ b/third_party/leveldatabase/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -112,7 +113,7 @@ config("leveldb_component_config") {
}
}
-component("leveldatabase") {
+jumbo_component("leveldatabase") {
sources = leveldb_sources
configs -= [ "//build/config/compiler:chromium_code" ]