From 9d729bbe070382758f9f46c9c14d185089613e3e Mon Sep 17 00:00:00 2001 From: laokz Date: Sun, 2 Nov 2025 14:12:47 +0800 Subject: [PATCH] Adapt to gcc14 https://gcc.gnu.org/gcc-14/porting_to.html#header-dep-changes --- 04-riscv-distdir_deps.patch | 3 ++- abseil-cpp-adapt-to-gcc14.patch | 12 ++++++++++++ bazel.spec | 17 ++++++++--------- thirdparty-zlib-adapt-to-gcc14.patch | 10 ++++++++++ 4 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 abseil-cpp-adapt-to-gcc14.patch create mode 100644 thirdparty-zlib-adapt-to-gcc14.patch diff --git a/04-riscv-distdir_deps.patch b/04-riscv-distdir_deps.patch index e3799e6..64fab88 100644 --- a/04-riscv-distdir_deps.patch +++ b/04-riscv-distdir_deps.patch @@ -1,12 +1,13 @@ --- a/distdir_deps.bzl 2024-07-09 14:42:34.465863400 +0800 +++ b/distdir_deps.bzl 2024-07-09 15:18:31.432886425 +0800 -@@ -163,6 +163,10 @@ +@@ -163,6 +163,11 @@ }, "com_google_absl": { "archive": "20211102.0.tar.gz", + "patch_args": ["-p1"], + "patches": [ + "//third_party:abseil-cpp/abseil-cpp-riscv.patch", ++ "//third_party:abseil-cpp/abseil-cpp-adapt-to-gcc14.patch", + ], "sha256": "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4", "urls": [ diff --git a/abseil-cpp-adapt-to-gcc14.patch b/abseil-cpp-adapt-to-gcc14.patch new file mode 100644 index 0000000..2ead169 --- /dev/null +++ b/abseil-cpp-adapt-to-gcc14.patch @@ -0,0 +1,12 @@ +diff --git a/absl/strings/internal/str_format/extension.h b/absl/strings/internal/str_format/extension.h +index 55cbb56..67d4cc8 100644 +--- a/absl/strings/internal/str_format/extension.h ++++ b/absl/strings/internal/str_format/extension.h +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "absl/base/config.h" + #include "absl/base/port.h" diff --git a/bazel.spec b/bazel.spec index 9ad6ad1..a4d1a0a 100644 --- a/bazel.spec +++ b/bazel.spec @@ -2,16 +2,18 @@ Name: bazel Version: 5.3.0 -Release: 3 +Release: 4 Summary: Correct, reproducible, and fast builds for everyone. License: Apache License 2.0 URL: http://bazel.io/ Source0: https://github.com/bazelbuild/bazel/releases/download/%{version}/bazel-%{version}-dist.zip Source1: abseil-cpp-riscv.patch +Source2: abseil-cpp-adapt-to-gcc14.patch Patch0: 01-fix-invalid-jni_md-select.patch Patch2: 03-set-default-nojdk.patch Patch3: linux-bazel-path-from-getauxval.patch Patch4: 04-riscv-distdir_deps.patch +Patch5: thirdparty-zlib-adapt-to-gcc14.patch # for folks with 'bazel' v1 package installed Conflicts: bazel Conflicts: bazel2 @@ -29,15 +31,9 @@ Requires: java-11-openjdk-devel Correct, reproducible, and fast builds for everyone. %prep -%setup -q -c -n bazel-%{version} -%patch0 -p1 -%patch2 -p1 -%patch3 -p1 -%ifarch riscv64 -%patch4 -p1 +%autosetup -c -n bazel-%{version} -p1 mkdir third_party/abseil-cpp -cp %{SOURCE1} third_party/abseil-cpp -%endif +cp %{SOURCE1} %{SOURCE2} third_party/abseil-cpp %build find . -type f -regextype posix-extended -iregex '.*(sh|txt|py|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)' -exec %{__sed} -i -e '1s|^#!/usr/bin/env python$|#!/usr/bin/env python3|' "{}" \; @@ -97,6 +93,9 @@ env ./scripts/generate_bash_completion.sh --bazel=output/bazel --output=output/b %attr(0755,root,root) %{bashcompdir}/bazel %changelog +* Mon Nov 03 2025 laokz - 5.3.0-4 +- adapt to gcc14 + * Wed Feb 19 2025 laokz - 5.3.0-3 - remove unused patch1 diff --git a/thirdparty-zlib-adapt-to-gcc14.patch b/thirdparty-zlib-adapt-to-gcc14.patch new file mode 100644 index 0000000..7200cb9 --- /dev/null +++ b/thirdparty-zlib-adapt-to-gcc14.patch @@ -0,0 +1,10 @@ +diff --git a/third_party/zlib/gzguts.h b/third_party/zlib/gzguts.h +index 57faf37..4a7e51e 100755 +--- a/third_party/zlib/gzguts.h ++++ b/third_party/zlib/gzguts.h +@@ -217,3 +217,5 @@ char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); + unsigned ZLIB_INTERNAL gz_intmax OF((void)); + # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) + #endif ++ ++#include -- Gitee