This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch maint-10.0.x
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit b7b92fa88ea54123b4fd804835556c7763b3ea40
Author: Neal Richardson <neal.p.richard...@gmail.com>
AuthorDate: Tue Oct 18 20:54:46 2022 -0400

    ARROW-18080: [C++] Remove gcc <= 4.9 workarounds (#14441)
    
    This is most of them I could find. There's another one in 
`python/pyarrow/src/arrow/python/datetime.cc` to remove but it's more involved.
    
    Authored-by: Neal Richardson <neal.p.richard...@gmail.com>
    Signed-off-by: Sutou Kouhei <k...@clear-code.com>
---
 cpp/cmake_modules/SetupCxxFlags.cmake       | 39 +++++++++--------------------
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 19 +++-----------
 cpp/src/arrow/dataset/file_parquet.cc       |  9 -------
 cpp/thirdparty/versions.txt                 |  3 ---
 4 files changed, 15 insertions(+), 55 deletions(-)

diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake 
b/cpp/cmake_modules/SetupCxxFlags.cmake
index 51ef979a02..0bd5c3090e 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -400,22 +400,13 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CXX_ONLY_FLAGS "${CXX_ONLY_FLAGS} -Wno-noexcept-type")
   endif()
 
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.2")
-    # Disabling semantic interposition allows faster calling conventions
-    # when calling global functions internally, and can also help inlining.
-    # See 
https://stackoverflow.com/questions/35745543/new-option-in-gcc-5-3-fno-semantic-interposition
-    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -fno-semantic-interposition")
-  endif()
-
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9")
-    # Add colors when paired with ninja
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
-  endif()
+  # Disabling semantic interposition allows faster calling conventions
+  # when calling global functions internally, and can also help inlining.
+  # See 
https://stackoverflow.com/questions/35745543/new-option-in-gcc-5-3-fno-semantic-interposition
+  set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -fno-semantic-interposition")
 
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0")
-    # Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43407
-    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-attributes")
-  endif()
+  # Add colors when paired with ninja
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
 
   if(CMAKE_UNITY_BUILD)
     # Work around issue similar to 
https://bugs.webkit.org/show_bug.cgi?id=176869
@@ -507,18 +498,12 @@ if(ARROW_CPU_FLAG STREQUAL "armv8")
 
     add_definitions(-DARROW_HAVE_NEON)
 
-    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION 
VERSION_LESS
-                                                "5.4")
-      message(WARNING "Disable Armv8 CRC and Crypto as compiler doesn't 
support them well."
-      )
-    else()
-      if(ARROW_ARMV8_ARCH_FLAG MATCHES "\\+crypto")
-        add_definitions(-DARROW_HAVE_ARMV8_CRYPTO)
-      endif()
-      # armv8.1+ implies crc support
-      if(ARROW_ARMV8_ARCH_FLAG MATCHES "armv8\\.[1-9]|\\+crc")
-        add_definitions(-DARROW_HAVE_ARMV8_CRC)
-      endif()
+    if(ARROW_ARMV8_ARCH_FLAG MATCHES "\\+crypto")
+      add_definitions(-DARROW_HAVE_ARMV8_CRYPTO)
+    endif()
+    # armv8.1+ implies crc support
+    if(ARROW_ARMV8_ARCH_FLAG MATCHES "armv8\\.[1-9]|\\+crc")
+      add_definitions(-DARROW_HAVE_ARMV8_CRC)
     endif()
   elseif(NOT ARROW_SIMD_LEVEL STREQUAL "NONE")
     message(WARNING "ARROW_SIMD_LEVEL=${ARROW_SIMD_LEVEL} not supported by 
Arm.")
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index b1c3201894..b44521e0c1 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -652,18 +652,9 @@ endif()
 if(DEFINED ENV{ARROW_SNAPPY_URL})
   set(SNAPPY_SOURCE_URL "$ENV{ARROW_SNAPPY_URL}")
 else()
-  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION 
VERSION_LESS
-                                              "4.9")
-    # There is a bug in GCC < 4.9 with Snappy 1.1.9, so revert to 1.1.8 
"SNAPPY_OLD" for those (ARROW-14661)
-    set_urls(SNAPPY_SOURCE_URL
-             
"https://github.com/google/snappy/archive/${ARROW_SNAPPY_OLD_BUILD_VERSION}.tar.gz";
-             
"${THIRDPARTY_MIRROR_URL}/snappy-${ARROW_SNAPPY_OLD_BUILD_VERSION}.tar.gz")
-    set(ARROW_SNAPPY_BUILD_SHA256_CHECKSUM 
${ARROW_SNAPPY_OLD_BUILD_SHA256_CHECKSUM})
-  else()
-    set_urls(SNAPPY_SOURCE_URL
-             
"https://github.com/google/snappy/archive/${ARROW_SNAPPY_BUILD_VERSION}.tar.gz";
-             
"${THIRDPARTY_MIRROR_URL}/snappy-${ARROW_SNAPPY_BUILD_VERSION}.tar.gz")
-  endif()
+  set_urls(SNAPPY_SOURCE_URL
+           
"https://github.com/google/snappy/archive/${ARROW_SNAPPY_BUILD_VERSION}.tar.gz";
+           
"${THIRDPARTY_MIRROR_URL}/snappy-${ARROW_SNAPPY_BUILD_VERSION}.tar.gz")
 endif()
 
 if(DEFINED ENV{ARROW_SUBSTRAIT_URL})
@@ -4584,10 +4575,6 @@ endif()
 
 macro(build_awssdk)
   message(STATUS "Building AWS C++ SDK from source")
-  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION 
VERSION_LESS
-                                              "4.9")
-    message(FATAL_ERROR "AWS C++ SDK requires gcc >= 4.9")
-  endif()
   set(AWSSDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/awssdk_ep-install")
   set(AWSSDK_INCLUDE_DIR "${AWSSDK_PREFIX}/include")
   set(AWSSDK_LIB_DIR "lib")
diff --git a/cpp/src/arrow/dataset/file_parquet.cc 
b/cpp/src/arrow/dataset/file_parquet.cc
index f07254e111..da9748de96 100644
--- a/cpp/src/arrow/dataset/file_parquet.cc
+++ b/cpp/src/arrow/dataset/file_parquet.cc
@@ -742,16 +742,7 @@ Result<std::optional<int64_t>> 
ParquetFileFragment::TryCountRows(
     compute::Expression predicate) {
   DCHECK_NE(metadata_, nullptr);
   if (ExpressionHasFieldRefs(predicate)) {
-#if defined(__GNUC__) && (__GNUC__ < 5)
-    // ARROW-12694: with GCC 4.9 (RTools 35) we sometimes segfault here if we 
move(result)
-    auto result = TestRowGroups(std::move(predicate));
-    if (!result.ok()) {
-      return result.status();
-    }
-    auto expressions = result.ValueUnsafe();
-#else
     ARROW_ASSIGN_OR_RAISE(auto expressions, 
TestRowGroups(std::move(predicate)));
-#endif
     int64_t rows = 0;
     for (size_t i = 0; i < row_groups_->size(); i++) {
       // If the row group is entirely excluded, exclude it from the row count
diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt
index 767cb2c860..0cc496e938 100644
--- a/cpp/thirdparty/versions.txt
+++ b/cpp/thirdparty/versions.txt
@@ -81,9 +81,6 @@ 
ARROW_RE2_BUILD_SHA256_CHECKSUM=f89c61410a072e5cbcf8c27e3a778da7d6fd2f2b5b1445cd
 # 1.1.9 is patched to implement https://github.com/google/snappy/pull/148 if 
this is bumped, remove the patch
 ARROW_SNAPPY_BUILD_VERSION=1.1.9
 
ARROW_SNAPPY_BUILD_SHA256_CHECKSUM=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7
-# There is a bug in GCC < 4.9 with Snappy 1.1.9, so revert to 1.1.8 for those 
(ARROW-14661)
-ARROW_SNAPPY_OLD_BUILD_VERSION=1.1.8
-ARROW_SNAPPY_OLD_BUILD_SHA256_CHECKSUM=16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f
 ARROW_SUBSTRAIT_BUILD_VERSION=v0.6.0
 
ARROW_SUBSTRAIT_BUILD_SHA256_CHECKSUM=7b8583b9684477e9027f417bbfb4febb8acfeb01923dcaa7cf0fd3f921d69c88
 ARROW_THRIFT_BUILD_VERSION=0.16.0

Reply via email to