From b047a677de96c852aa3622fda5be142662a39999 Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 7 Nov 2025 09:35:18 +0800 Subject: [PATCH] C code adapt to gcc14 https://github.com/apache/bigtop/pull/1342 https://gcc.gnu.org/gcc-14/porting_to.html#header-dep-changes --- 05-c-code-adapt-to-gcc14.patch | 67 ++++++++++++++++++++++++++++++++++ hadoop.spec | 6 ++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 05-c-code-adapt-to-gcc14.patch diff --git a/05-c-code-adapt-to-gcc14.patch b/05-c-code-adapt-to-gcc14.patch new file mode 100644 index 0000000..8c602e7 --- /dev/null +++ b/05-c-code-adapt-to-gcc14.patch @@ -0,0 +1,67 @@ +diff --git a/hadoop-common-project/hadoop-common/HadoopCommon.cmake b/hadoop-common-project/hadoop-common/HadoopCommon.cmake +index 4de70ac3..eb45a41d 100644 +--- a/hadoop-common-project/hadoop-common/HadoopCommon.cmake ++++ b/hadoop-common-project/hadoop-common/HadoopCommon.cmake +@@ -144,6 +144,7 @@ hadoop_add_linker_flags("${LINKER_SHARED_FLAGS}") + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Make GNU extensions available. + hadoop_add_compiler_flags("-D_GNU_SOURCE") ++ hadoop_add_compiler_flags("-Wno-error=implicit-function-declaration") + + # If JVM_ARCH_DATA_MODEL is 32, compile all binaries as 32-bit. + if(JVM_ARCH_DATA_MODEL EQUAL 32) +@@ -212,4 +213,4 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + endif() + + # Set GNU99 as the C standard to use +-set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}") +\ No newline at end of file ++set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}") +diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/content_summary.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/content_summary.h +index 6762a65c..d9809bab 100644 +--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/content_summary.h ++++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/content_summary.h +@@ -19,6 +19,7 @@ + #define HDFSPP_CONTENT_SUMMARY_H_ + + #include ++#include + + namespace hdfs { + +diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/fsinfo.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/fsinfo.h +index 103cf133..156ed445 100644 +--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/fsinfo.h ++++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/fsinfo.h +@@ -19,6 +19,7 @@ + #define HDFSPP_FSINFO_H_ + + #include ++#include + + namespace hdfs { + +diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/statinfo.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/statinfo.h +index 1da1f18a..5924d1db 100644 +--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/statinfo.h ++++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/statinfo.h +@@ -19,6 +19,7 @@ + #define HDFSPP_STATINFO_H_ + + #include ++#include + + namespace hdfs { + +diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h +index bc3d8b96..a7f735af 100644 +--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h ++++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + namespace hdfs diff --git a/hadoop.spec b/hadoop.spec index b7179f2..044a4fe 100644 --- a/hadoop.spec +++ b/hadoop.spec @@ -13,7 +13,7 @@ Name: hadoop Version: 3.3.6 -Release: 6 +Release: 7 Summary: A software platform for processing vast amounts of data # The BSD license file is missing # https://issues.apache.org/jira/browse/HADOOP-9849 @@ -43,6 +43,7 @@ Patch0: 01-lock-triple-beam-version-to-1.3.0.patch Patch1: 02-Upgrade-os-maven-plugin-to-1.7.1.patch Patch2: 03-Fix-build-on-riscv.patch Patch3: 04-Enhance-access-control-for-RunJar.patch +Patch4: 05-c-code-adapt-to-gcc14.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: java-1.8.0-openjdk-devel maven hostname maven-local tomcat cmake snappy openssl-devel @@ -1162,6 +1163,9 @@ fi %config(noreplace) %{_sysconfdir}/%{name}/container-executor.cfg %changelog +* Fri Nov 07 2025 laokz - 3.3.6-7 +- C code adapt to gcc14 + * Fri Dec 13 2024 xuduo - 3.3.6-6 - Add huawei repository -- Gitee