package/zeek: add various fixes for gcc >= 13.x

Fixes:
https://autobuild.buildroot.net/results/906/9061a358d5b37d7674fe5498686cecefda6cf51e/

The build error

  ripemd_160.hpp:52:23: error: 'uint8_t' was not declared in this scope

which is fixed by patch 0002, afaics, first occurred on 2024-04-04:
https://autobuild.buildroot.net/results/7ff/7ff3d6a09bd4911ff78e01c14f2bfb7da3d43d60/
so a backport should be considered.

After fixing the build error other build errors occurred which are fixed by
backporting various upstream commits.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Bernd Kuhls
2026-01-04 14:17:17 +01:00
committed by Peter Korsgaard
parent b76884a0b6
commit eb8ee9f7fd
3 changed files with 112 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From c41f1c24f6ed2a5441b231b17e1889580bbbc01c Mon Sep 17 00:00:00 2001
From: Dominik Charousset <dominik@charousset.de>
Date: Wed, 29 Mar 2023 17:01:37 +0200
Subject: [PATCH] Add missing includes, fix build with GCC 13
(cherry picked from commit c2ee99c38989deba848cc4c4ec9a230fa71162f7)
Upstream: https://github.com/zeek/actor-framework/commit/c41f1c24f6ed2a5441b231b17e1889580bbbc01c
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
libcaf_core/caf/detail/ripemd_160.hpp | 1 +
libcaf_core/caf/telemetry/metric_type.hpp | 2 ++
2 files changed, 3 insertions(+)
diff --git a/libcaf_core/caf/detail/ripemd_160.hpp b/libcaf_core/caf/detail/ripemd_160.hpp
index ea9f44cec3..ec2482ecfa 100644
--- a/auxil/broker/caf/libcaf_core/caf/detail/ripemd_160.hpp
+++ b/auxil/broker/caf/libcaf_core/caf/detail/ripemd_160.hpp
@@ -42,6 +42,7 @@
#include <array>
#include <string>
+#include <cstdint>
#include "caf/detail/core_export.hpp"
diff --git a/libcaf_core/caf/telemetry/metric_type.hpp b/libcaf_core/caf/telemetry/metric_type.hpp
index 0525dd1da7..2047b5f6cc 100644
--- a/auxil/broker/caf/libcaf_core/caf/telemetry/metric_type.hpp
+++ b/auxil/broker/caf/libcaf_core/caf/telemetry/metric_type.hpp
@@ -4,6 +4,8 @@
#pragma once
+#include <cstdint>
+
namespace caf::telemetry {
enum class metric_type : uint8_t {

View File

@@ -0,0 +1,48 @@
From 1f87382302896876df0838d83f0d107aae4b89d3 Mon Sep 17 00:00:00 2001
From: Tim Wojtulewicz <tim@corelight.com>
Date: Thu, 10 Jul 2025 16:28:40 -0700
Subject: [PATCH] Fix some missing #includes resulting from removal of
ghc::filesystem
Upstream: https://github.com/zeek/zeek/commit/1f87382302896876df0838d83f0d107aae4b89d3
[Bernd:
- backported only UDP.cc change from upstream commit
- added similar change to src/script_opt/CPP/GenFunc.cc, no upstream
commit due to switch to from transform to std::ranges::transform:
https://github.com/zeek/zeek/commit/72c79006ac028558004a259081fa8e02de3ebe85
to fix build error:
/home/bernd/buildroot/output/build/zeek-4.1.1/src/script_opt/CPP/GenFunc.cc:
In member function std::string zeek::detail::CPPCompile::BodyName(const zeek::detail::FuncInfo&):
/home/bernd/buildroot/output/build/zeek-4.1.1/src/script_opt/CPP/GenFunc.cc:214:17:
error: transform was not declared in this scope
214 | transform(fns.begin(), fns.end(), fns.begin(), canonicalize);]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/packet_analysis/protocol/udp/UDP.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/packet_analysis/protocol/udp/UDP.cc b/src/packet_analysis/protocol/udp/UDP.cc
index bebfabd3fbb..bf114f5518b 100644
--- a/src/packet_analysis/protocol/udp/UDP.cc
+++ b/src/packet_analysis/protocol/udp/UDP.cc
@@ -1,6 +1,9 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/packet_analysis/protocol/udp/UDP.h"
+
+#include <algorithm>
+
#include "zeek/RunState.h"
#include "zeek/Conn.h"
#include "zeek/session/Manager.h"
--- a/src/script_opt/CPP/GenFunc.cc
+++ b/src/script_opt/CPP/GenFunc.cc
@@ -1,5 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.
+#include <algorithm>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>

View File

@@ -0,0 +1,24 @@
From 122b8d6052ab987237dd8eb3feeed598230881f7 Mon Sep 17 00:00:00 2001
From: Tim Wojtulewicz <tim@corelight.com>
Date: Mon, 10 Apr 2023 16:07:18 -0700
Subject: [PATCH] Add cstdint to WeirdState.h to fix compilation error on gcc13
Upstream: https://github.com/zeek/zeek/commit/122b8d6052ab987237dd8eb3feeed598230881f7
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/WeirdState.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/WeirdState.h b/src/WeirdState.h
index 5b8e90fba6a..b34a6da8e82 100644
--- a/src/WeirdState.h
+++ b/src/WeirdState.h
@@ -2,6 +2,7 @@
#pragma once
+#include <cstdint>
#include <string>
#include <unordered_map>