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

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new f5d93b58fc6 Fix PAX build failure on GCC 8.x (Rocky Linux 8)
f5d93b58fc6 is described below

commit f5d93b58fc691064a41fbb3dd340dccc053f65f3
Author: Dianjin Wang <[email protected]>
AuthorDate: Tue Dec 30 11:50:10 2025 +0800

    Fix PAX build failure on GCC 8.x (Rocky Linux 8)
    
    1. Remove explicit -Werror=pessimizing-move flag from CMakeLists.txt.
       This flag was added in commit e7e07c27a7 to catch pessimizing-move
       warnings on higher GCC versions, but it breaks compilation on GCC 8.x
       where this warning option does not exist. The fix is safe because
       GCC 9+ enables -Wpessimizing-move by default and the existing -Werror
       flag already converts all warnings to errors.
    
    2. Fix fast_io.cc compatibility issues:
       - Add missing <unistd.h> include for pread()
       - Define uring_likely macro fallback for older liburing versions
    
    See: Issue#1441 <https://github.com/apache/cloudberry/issues/1441>
---
 contrib/pax_storage/CMakeLists.txt                   |  5 ++++-
 contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc |  2 +-
 contrib/pax_storage/src/cpp/comm/fast_io.cc          | 11 +++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/contrib/pax_storage/CMakeLists.txt 
b/contrib/pax_storage/CMakeLists.txt
index 5942f3bd913..e45eab560e6 100644
--- a/contrib/pax_storage/CMakeLists.txt
+++ b/contrib/pax_storage/CMakeLists.txt
@@ -21,7 +21,10 @@ set(CMAKE_CXX_STANDARD 17)
 set(TOP_DIR ${PROJECT_SOURCE_DIR}/../..)
 set(CBDB_INCLUDE_DIR ${TOP_DIR}/src/include)
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror 
-Werror=pessimizing-move  -Wno-unused-function -Wno-error=ignored-qualifiers 
-Wno-error=array-bounds  -Wuninitialized -Winit-self -Wstrict-aliasing 
-Wno-missing-field-initializers -Wno-unused-parameter -Wno-clobbered 
-Wno-sized-deallocation -g")
+# Base CXX flags
+# Note: -Wpessimizing-move is enabled by default in GCC 9+ and will be caught 
by -Werror
+# No need to explicitly add -Werror=pessimizing-move (which breaks GCC 8.x 
compatibility)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror 
-Wno-unused-function -Wno-error=ignored-qualifiers -Wno-error=array-bounds 
-Wuninitialized -Winit-self -Wstrict-aliasing -Wno-missing-field-initializers 
-Wno-unused-parameter -Wno-clobbered -Wno-sized-deallocation -g")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-parameter 
-Wno-parameter-name")
 
 option(USE_MANIFEST_API "Use manifest API" OFF)
diff --git a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc 
b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
index baca9efe47d..e655f469bc3 100644
--- a/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
+++ b/contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc
@@ -700,7 +700,7 @@ pax::MicroPartitionMetadata 
PaxGetMicroPartitionMetadata(Relation rel,
     paxc::FetchMicroPartitionAuxRow(rel, snapshot, block_id,
                                     FetchMicroPartitionAuxRowCallbackWrapper,
                                     &ctx);
-    return std::move(ctx.info);
+    return ctx.info;
   }
   CBDB_WRAP_END;
 }
diff --git a/contrib/pax_storage/src/cpp/comm/fast_io.cc 
b/contrib/pax_storage/src/cpp/comm/fast_io.cc
index 5b9e593def9..7ed96d7a377 100644
--- a/contrib/pax_storage/src/cpp/comm/fast_io.cc
+++ b/contrib/pax_storage/src/cpp/comm/fast_io.cc
@@ -27,6 +27,17 @@
 
 #include "fast_io.h"
 
+#include <unistd.h>  // for pread
+
+// uring_likely may not be defined in older liburing versions
+#ifndef uring_likely
+#if __GNUC__ >= 3
+#define uring_likely(x) __builtin_expect((x) != 0, 1)
+#else
+#define uring_likely(x) ((x) != 0)
+#endif
+#endif
+
 namespace pax
 {
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to