diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index f6c90a584b021..343b2ae27bf8d 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -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" @@ -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 @@ -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