This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new febedbb870e [fix](proto) upgrade protobuf to 21.11 (#43035)
febedbb870e is described below
commit febedbb870ed12c9ce60aba48b731eb7d47412fd
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Fri Nov 1 12:57:17 2024 +0800
[fix](proto) upgrade protobuf to 21.11 (#43035)
### What problem does this PR solve?
Problem Summary:
Upgrade protoc to 21.11, to fix some cve
### Release note
Bump protobuf version to 21.11
---
thirdparty/build-thirdparty.sh | 40 +++++++++++++---------------------------
thirdparty/vars.sh | 9 +++++----
2 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index 78415a2a4a3..ed75aaefe73 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -416,19 +416,6 @@ build_thrift() {
build_protobuf() {
check_if_source_exist "${PROTOBUF_SOURCE}"
cd "${TP_SOURCE_DIR}/${PROTOBUF_SOURCE}"
- rm -fr gmock
-
- # NOTE(amos): -Wl,--undefined=pthread_create force searching for pthread
symbols.
- # See https://stackoverflow.com/a/65348893/1329147 for detailed
explanation.
- mkdir gmock
- cd gmock
- tar xf "${TP_SOURCE_DIR}/${GTEST_NAME}"
-
- mv "${GTEST_SOURCE}" gtest
-
- cd "${TP_SOURCE_DIR}/${PROTOBUF_SOURCE}"
-
- ./autogen.sh
if [[ "${KERNEL}" == 'Darwin' ]]; then
ldflags="-L${TP_LIB_DIR}"
@@ -436,21 +423,20 @@ build_protobuf() {
ldflags="-L${TP_LIB_DIR} -static-libstdc++ -static-libgcc
-Wl,--undefined=pthread_create"
fi
- CXXFLAGS="-fPIC -O2 -I${TP_INCLUDE_DIR}" \
- LDFLAGS="${ldflags}" \
- ./configure --prefix="${TP_INSTALL_DIR}" --disable-shared
--enable-static --with-zlib="${TP_INSTALL_DIR}/include"
-
- # ATTN: If protoc is not built fully statically the linktime libc may
newer than runtime.
- # This will casue protoc cannot run
- # If you really need to dynamically link protoc, please set the
environment variable DYN_LINK_PROTOC=1
+ mkdir -p cmake/build
+ cd cmake/build
- if [[ "${DYN_LINK_PROTOC:-0}" == "1" || "${KERNEL}" == 'Darwin' ]]; then
- echo "link protoc dynamiclly"
- else
- cd src
- sed -i 's/^AM_LDFLAGS\(.*\)$/AM_LDFLAGS\1 -all-static/' Makefile
- cd -
- fi
+ CXXFLAGS="-O2 -I${TP_INCLUDE_DIR}" \
+ LDFLAGS="${ldflags}" \
+ "${CMAKE_CMD}" -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_PREFIX_PATH="${TP_INSTALL_DIR}" \
+ -Dprotobuf_USE_EXTERNAL_GTEST=ON \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+ -Dprotobuf_BUILD_SHARED_LIBS=OFF \
+ -Dprotobuf_BUILD_TESTS=OFF \
+ -Dprotobuf_WITH_ZLIB_DEFAULT=ON \
+ -Dprotobuf_ABSL_PROVIDER=package \
+ -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" ../..
make -j "${PARALLEL}"
make install
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index c132a7ec9d6..f8d44514abd 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -73,10 +73,11 @@ THRIFT_SOURCE=thrift-0.16.0
THRIFT_MD5SUM="44cf1b54b4ec1890576c85804acfa637"
# protobuf
-PROTOBUF_DOWNLOAD="https://github.com/google/protobuf/archive/v3.15.0.tar.gz"
-PROTOBUF_NAME=protobuf-3.15.0.tar.gz
-PROTOBUF_SOURCE=protobuf-3.15.0
-PROTOBUF_MD5SUM="3fb6c41f7b3c621424543f43d54baa42"
+# brpc is not yet compatible with protobuf >= 22
+PROTOBUF_DOWNLOAD="https://github.com/protocolbuffers/protobuf/releases/download/v21.11/protobuf-all-21.11.tar.gz"
+PROTOBUF_NAME="protobuf-all-21.11.tar.gz"
+PROTOBUF_SOURCE=protobuf-21.11
+PROTOBUF_MD5SUM="b3b104f0374802e1add5d5d7a5a845ac"
# gflags
GFLAGS_DOWNLOAD="https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]