Skip to content

Commit

Permalink
[Enhancement] remove gcc14 detect in build-thirdparty script (#54576)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Xiaohua Cai <[email protected]>
(cherry picked from commit e494f6e)
  • Loading branch information
kevincai authored and mergify[bot] committed Jan 2, 2025
1 parent 7155f1b commit cfc7488
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,6 @@ check_prerequest() {
fi
}

# echo if gcc version is greater than 14.0.0
# else echo ""
echo_gt_gcc14() {
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
#gt gcc14
echo "$1"
fi
}

# sudo apt-get install cmake
# sudo yum install cmake
check_prerequest "${CMAKE_CMD} --version" "cmake"
Expand Down Expand Up @@ -599,7 +587,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_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_CXXFLAGS="-fPIC -Wno-redundant-move -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 @@ -664,8 +652,9 @@ build_flatbuffers() {
cd $BUILD_DIR
rm -rf CMakeCache.txt CMakeFiles/

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")
# reset the optimization level to O2 to avoid "stringop-overread" warnings/errors
export CXXFLAGS="$CXXFLAGS -O2"
export CPPFLAGS="$CPPFLAGS -O2"

LDFLAGS="-static-libstdc++ -static-libgcc" \
${CMAKE_CMD} .. -G "${CMAKE_GENERATOR}" -DFLATBUFFERS_BUILD_TESTS=OFF
Expand Down

0 comments on commit cfc7488

Please sign in to comment.