Skip to content

Commit 078cc1b

Browse files
committed
merge: revert two patch files
1 parent cb71e98 commit 078cc1b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

thirdparties/brpc/brpc.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ index 4ff38c5..b36de87 100644
459459

460460
+bool PrometheusMetricsDumper::DumpStatusJsonString(
461461
+ const std::string& name, const std::string& desc) {
462-
+ // If it is not in JSON format, return false; if it is in JSON format, print
462+
+ // 如果不是json格式,返回false, 是json格式则print
463463
+ BUTIL_RAPIDJSON_NAMESPACE::Document d;
464464
+ if (desc.size() == 2) {
465465
+ return false;
@@ -472,7 +472,7 @@ index 4ff38c5..b36de87 100644
472472
+ std::string("# TYPE ") + name + std::string(" gauge\n") +
473473
+ name + std::string("{");
474474
+
475-
+ // Traverse JSON and print
475+
+ // 遍历json并打印
476476
+ int count = 0;
477477
+ BUTIL_RAPIDJSON_NAMESPACE::Value::MemberIterator it = d.MemberBegin();
478478
+ while (it != d.MemberEnd()) {
@@ -2444,7 +2444,7 @@ index fe9055d..38dd7cb 100644
24442444
+
24452445
+ ASSERT_EQ("test4{name=\"haorooms\",address=\"word\"} 0\n", strformat);
24462446
+
2447-
+ // run result
2447+
+ // 运行结果
24482448
+ // [==========] Running 1 test from 1 test case.
24492449
+ // [----------] Global test environment set-up.
24502450
+ // [----------] 1 test from PrometheusMetricsDumperTest
@@ -3255,4 +3255,4 @@ index fc8bdf2c..020d5316 100644
32553255
-
32563256
#ifdef _MSC_VER
32573257
#define BAIDU_THREAD_LOCAL __declspec(thread)
3258-
#else
3258+
#else

thirdparties/brpc/fix-gcc11.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ index f8e1a491..b16d9487 100644
5656
+++ b/docs/cn/thread_local.md
5757
@@ -57,9 +57,9 @@ Use *p ... - still the errno of original pthread, undefined b
5858

59-
Strictly speaking, this issue is not caused by gcc4, but rather by the inaccurate signature of __errno_location provided by glibc. A function that returns a thread-local pointer depends on the segment register (a common implementation of TLS), which can't truly be considered const. Since we haven't found a method to override __errno_location yet, the current practical solution for this issue is as follows:
59+
严格地说这个问题不是gcc4导致的,而是glibc给__errno_location的签名不够准确,一个返回thread-local指针的函数依赖于段寄存器(TLS的一般实现方式),这怎么能算const呢?由于我们还未找到覆盖__errno_location的方法,所以这个问题目前实际的解决方法是:
6060

61-
-**Make sure to add `-D__const__=` to the gcc compilation options of projects that directly or indirectly use bthread, This defines `__const__`as empty, preventing gcc4 optimizations.**
62-
+**Make sure to add `-D__const__=__unused__` to the gcc compilation options of projects that directly or indirectly use bthread, This defines `__const__`as empty, preventing gcc4 optimizations.**
61+
-**务必在直接或间接使用bthread的项目的gcc编译选项中添加`-D__const__=`,即把`__const__`定义为空,避免gcc4做相关优化。**
62+
+**务必在直接或间接使用bthread的项目的gcc编译选项中添加`-D__const__=__unused__`,即把`__const__`定义为空,避免gcc4做相关优化。**
6363

64-
Defining `__const__`as empty has minimal impact on other parts of the program. Additionally, if you're not **directly** using errno (meaning errno doesn't appear in your project), or if you're using GCC
65-
-3.4,Even with GCC 3.4, the correctness of the program won't be affected even if you don't define`-D__const__=`,, but to safeguard against potential future issues, we strongly recommend adding it.
66-
+3.4,Even with GCC 3.4, the correctness of the program won't be affected even if you don't define`-D__const__=__unused__`,, but to safeguard against potential future issues, we strongly recommend adding it.
64+
`__const__`定义为空对程序其他部分的影响几乎为0。另外如果你没有**直接**使用errno(即你的项目中没有出现errno),或使用的是gcc
65+
-3.4,即使没有定义`-D__const__=`,程序的正确性也不会受影响,但为了防止未来可能的问题,我们强烈建议加上。
66+
+3.4,即使没有定义`-D__const__=__unused__`,程序的正确性也不会受影响,但为了防止未来可能的问题,我们强烈建议加上。
6767

68-
-It's important to note that, similar to errno, pthread_self also faces similar issues. However, in most cases, pthread_self serves little purpose beyond logging, and its impact is minimal. After defining`-D__const__=`, pthread_self will also function correctly.
69-
+It's important to note that, similar to errno, pthread_self also faces similar issues. However, in most cases, pthread_self serves little purpose beyond logging, and its impact is minimal. After defining`-D__const__=__unused__`, pthread_self will also function correctly.
68+
-需要说明的是,和errno类似,pthread_self也有类似的问题,不过一般pthread_self除了打日志没有其他用途,影响面较小,在`-D__const__=`后pthread_self也会正常。
69+
+需要说明的是,和errno类似,pthread_self也有类似的问题,不过一般pthread_self除了打日志没有其他用途,影响面较小,在`-D__const__=__unused__`后pthread_self也会正常。
7070
diff --git a/example/asynchronous_echo_c++/CMakeLists.txt b/example/asynchronous_echo_c++/CMakeLists.txt
7171
index 91c3953f..74414e2a 100644
7272
--- a/example/asynchronous_echo_c++/CMakeLists.txt
@@ -460,4 +460,4 @@ index e3367b0f..b43916b7 100644
460460
+set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -DNDEBUG -O2 -D__const__=__unused__ -D__STRICT_ANSI__ -pipe -W -Wall -Wno-unused-parameter -fPIC -fno-omit-frame-pointer")
461461
use_cxx11()
462462
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/output/bin)
463-
463+

0 commit comments

Comments
 (0)