Skip to content

Commit f5d93b5

Browse files
committed
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 e7e07c2 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 <#1441>
1 parent e905e58 commit f5d93b5

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

contrib/pax_storage/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ set(CMAKE_CXX_STANDARD 17)
2121
set(TOP_DIR ${PROJECT_SOURCE_DIR}/../..)
2222
set(CBDB_INCLUDE_DIR ${TOP_DIR}/src/include)
2323
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
24-
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")
24+
# Base CXX flags
25+
# Note: -Wpessimizing-move is enabled by default in GCC 9+ and will be caught by -Werror
26+
# No need to explicitly add -Werror=pessimizing-move (which breaks GCC 8.x compatibility)
27+
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")
2528
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-parameter -Wno-parameter-name")
2629

2730
option(USE_MANIFEST_API "Use manifest API" OFF)

contrib/pax_storage/src/cpp/catalog/pax_aux_table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ pax::MicroPartitionMetadata PaxGetMicroPartitionMetadata(Relation rel,
700700
paxc::FetchMicroPartitionAuxRow(rel, snapshot, block_id,
701701
FetchMicroPartitionAuxRowCallbackWrapper,
702702
&ctx);
703-
return std::move(ctx.info);
703+
return ctx.info;
704704
}
705705
CBDB_WRAP_END;
706706
}

contrib/pax_storage/src/cpp/comm/fast_io.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727

2828
#include "fast_io.h"
2929

30+
#include <unistd.h> // for pread
31+
32+
// uring_likely may not be defined in older liburing versions
33+
#ifndef uring_likely
34+
#if __GNUC__ >= 3
35+
#define uring_likely(x) __builtin_expect((x) != 0, 1)
36+
#else
37+
#define uring_likely(x) ((x) != 0)
38+
#endif
39+
#endif
40+
3041
namespace pax
3142
{
3243

0 commit comments

Comments
 (0)