Skip to content

Commit

Permalink
[Tool] update toolchain to 20240831 (StarRocks#50517)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Xiaohua Cai <[email protected]>
Signed-off-by: stdpain <[email protected]>
Co-authored-by: stdpain <[email protected]>
  • Loading branch information
kevincai and stdpain authored Sep 9, 2024
1 parent 2b36290 commit 5db79c8
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker/dockerfiles/dev-env/dev-env.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ARG GITHUB_TOKEN
# the root directory to build the project
ARG BUILD_ROOT=/build

FROM starrocks/toolchains-${distro}:main-20231123 as base
FROM starrocks/toolchains-${distro}:main-20240831 as base
ENV STARROCKS_THIRDPARTY=/var/local/thirdparty

WORKDIR /
Expand Down
8 changes: 4 additions & 4 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ check_prerequest() {
# echo if gcc version is greater than 14.0.0
# else echo ""
echo_gt_gcc14() {
local version=$($CC -dumpfullversion | grep -oP '(?<=\s)\d+\.\d+\.\d+' | head -1)
local version=$($CC --version | grep -oP '(?<=\s)\d+\.\d+\.\d+' | head -1)
if [[ $(echo -e "14.0.0\n$version" | sort -V | tail -1) == "14.0.0" ]]; then
echo ""
else
Expand Down Expand Up @@ -600,7 +600,7 @@ build_rocksdb() {

CFLAGS= \
EXTRA_CFLAGS="-I ${TP_INCLUDE_DIR} -I ${TP_INCLUDE_DIR}/snappy -I ${TP_INCLUDE_DIR}/lz4 -L${TP_LIB_DIR} ${FILE_PREFIX_MAP_OPTION}" \
EXTRA_CXXFLAGS=$(echo_opts_gcc14 -Wno-error=redundant-move)" -fPIC -Wno-deprecated-copy -Wno-stringop-truncation -Wno-pessimizing-move -I ${TP_INCLUDE_DIR} -I ${TP_INCLUDE_DIR}/snappy ${FILE_PREFIX_MAP_OPTION}" \
EXTRA_CXXFLAGS=$(echo_gt_gcc14 -Wno-error=redundant-move)" -fPIC -Wno-deprecated-copy -Wno-stringop-truncation -Wno-pessimizing-move -I ${TP_INCLUDE_DIR} -I ${TP_INCLUDE_DIR}/snappy ${FILE_PREFIX_MAP_OPTION}" \
EXTRA_LDFLAGS="-static-libstdc++ -static-libgcc" \
PORTABLE=1 make USE_RTTI=1 -j$PARALLEL static_lib

Expand Down Expand Up @@ -665,8 +665,8 @@ build_flatbuffers() {
cd $BUILD_DIR
rm -rf CMakeCache.txt CMakeFiles/

export CXXFLAGS="-O3 -fno-omit-frame-pointer -fPIC -g " $(echo_opts_gcc14 "-Wno-error=stringop-overread")
export CPPFLAGS="-O3 -fno-omit-frame-pointer -fPIC -g " $(echo_opts_gcc14 "-Wno-error=stringop-overread")
export CXXFLAGS="-O3 -fno-omit-frame-pointer -fPIC -g "$(echo_gt_gcc14 "-Wno-error=stringop-overread")
export CPPFLAGS="-O3 -fno-omit-frame-pointer -fPIC -g "$(echo_gt_gcc14 "-Wno-error=stringop-overread")

LDFLAGS="-static-libstdc++ -static-libgcc" \
${CMAKE_CMD} .. -G "${CMAKE_GENERATOR}" -DFLATBUFFERS_BUILD_TESTS=OFF
Expand Down
31 changes: 26 additions & 5 deletions thirdparty/download-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ if [ ! -f $PATCHED_MARK ] && [ $MARIADB_SOURCE = "mariadb-connector-c-3.2.5" ];
touch $PATCHED_MARK
echo "Finished patching $MARIADB_SOURCE"
fi
if [ ! -f $PATCHED_MARK ] && [ $MARIADB_SOURCE = "mariadb-connector-c-3.1.4" ]; then
patch -p0 < $TP_PATCH_DIR/mariadb-connector-c-3.1.4-gcc14.patch
if [ ! -f $PATCHED_MARK ] && [ $MARIADB_SOURCE = "mariadb-connector-c-3.1.14" ]; then
patch -p1 < $TP_PATCH_DIR/mariadb-connector-c-3.1.14-gcc14.patch
touch $PATCHED_MARK
echo "Finished patching $MARIADB_SOURCE"
fi
Expand Down Expand Up @@ -463,9 +463,11 @@ cd -
echo "Finished patching $VPACK_SOURCE"

# patch avro-c
cd $TP_SOURCE_DIR/$AVRO_SOURCE/lang/c
if [ ! -f $PATCHED_MARK ] && [ $AVRO_SOURCE = "avro-release-1.10.2" ]; then
touch $PATCHED_MARK
cd $TP_SOURCE_DIR/$AVRO_SOURCE/lang/c
patch -p0 < $TP_PATCH_DIR/avro-1.10.2.c.patch
cd $TP_SOURCE_DIR/$AVRO_SOURCE
cp $TP_PATCH_DIR/avro-1.10.2.c.findjansson.patch $TP_SOURCE_DIR/$AVRO_SOURCE/lang/c/Findjansson.cmake
patch -p1 < $TP_PATCH_DIR/avro-1.10.2.c.gcc14.patch
touch $PATCHED_MARK
Expand All @@ -492,6 +494,14 @@ fi
echo "Finished patching $SASL_SOURCE"
cd -

cd $TP_SOURCE_DIR/$RAPIDJSON_SOURCE
if [ ! -f $PATCHED_MARK ] && [ $RAPIDJSON_SOURCE = "rapidjson-1.1.0" ]; then
patch -p1 < $TP_PATCH_DIR/rapidjson-gcc14.patch
touch $PATCHED_MARK
fi
echo "Finished patching $RAPIDJSON_SOURCE"
cd -

# patch arrow
if [[ -d $TP_SOURCE_DIR/$ARROW_SOURCE ]] ; then
cd $TP_SOURCE_DIR/$ARROW_SOURCE
Expand Down Expand Up @@ -534,6 +544,17 @@ if [[ -d $TP_SOURCE_DIR/$BITSHUFFLE_SOURCE ]] ; then
echo "Finished patching $BITSHUFFLE_SOURCE"
fi

#patch clucene
if [[ -d $TP_SOURCE_DIR/$CLUCENE_SOURCE ]] ; then
cd $TP_SOURCE_DIR/$CLUCENE_SOURCE
if [ ! -f "$PATCHED_MARK" ] ; then
patch -p1 < "$TP_PATCH_DIR/clucene-gcc14.patch"
touch "$PATCHED_MARK"
fi
cd -
echo "Finished patching $CLUCENE_SOURCE"
fi

#patch poco
if [[ -d $TP_SOURCE_DIR/$POCO_SOURCE ]] ; then
cd $TP_SOURCE_DIR/$POCO_SOURCE
Expand All @@ -550,8 +571,8 @@ fi

if [[ -d $TP_SOURCE_DIR/$BREAK_PAD_SOURCE ]] ; then
cd $TP_SOURCE_DIR/$BREAK_PAD_SOURCE
if [ ! -f "$PATCHED_MARK" ] && [[ $BREAK_PAD_SOURCE == "breakpad-2022.07.02" ]] ; then
patch -p1 < "$TP_PATCH_DIR/breakpad-2022.07.02.patch"
if [ ! -f "$PATCHED_MARK" ] && [[ $BREAK_PAD_SOURCE == "breakpad-2022.07.12" ]] ; then
patch -p1 < "$TP_PATCH_DIR/breakpad-2022.07.12.patch"
touch "$PATCHED_MARK"
fi
cd -
Expand Down
12 changes: 12 additions & 0 deletions thirdparty/patches/clucene-gcc14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/core/CLucene/document/DateTools.cpp b/src/core/CLucene/document/DateTools.cpp
index f99ab25..72cb74f 100644
--- a/src/core/CLucene/document/DateTools.cpp
+++ b/src/core/CLucene/document/DateTools.cpp
@@ -8,6 +8,7 @@

#include "DateTools.h"
#include "CLucene/util/Misc.h"
+#include <ctime>

CL_NS_USE(util)
CL_NS_DEF(document)
45 changes: 45 additions & 0 deletions thirdparty/patches/rapidjson-gcc14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 3b2441b87f99ab65f37b141a7b548ebadb607b96 Mon Sep 17 00:00:00 2001
From: Janusz Chorko <[email protected]>
Date: Fri, 26 Aug 2016 21:17:38 +0200
Subject: [PATCH 1/2] Removed non-compiling assignment operator. Fixed #718

---
include/rapidjson/document.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index e3e20dfbd..b0f1f70be 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -316,8 +316,6 @@ struct GenericStringRef {

GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {}

- GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }
-
//! implicit conversion to plain CharType pointer
operator const Ch *() const { return s; }


From 862c39be371278a45a88d4d1d75164be57bb7e2d Mon Sep 17 00:00:00 2001
From: Janusz Chorko <[email protected]>
Date: Fri, 26 Aug 2016 21:26:50 +0200
Subject: [PATCH 2/2] Explicitly disable copy assignment operator

---
include/rapidjson/document.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index b0f1f70be..19f5a6a5f 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -326,6 +326,8 @@ struct GenericStringRef {
//! Disallow construction from non-const array
template<SizeType N>
GenericStringRef(CharType (&str)[N]) /* = delete */;
+ //! Copy assignment operator not permitted - immutable type
+ GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */;
};

//! Mark a character pointer as constant string

0 comments on commit 5db79c8

Please sign in to comment.