Skip to content
Snippets Groups Projects
Verified Commit 25d2e87b authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

strace: Fix builds with musl

This backports a set of patches from upstream to fix build error:

| ../strace-5.5/xlat/inet_protocols.h:232:1: error: static assertion
failed: "IPPROTO_MAX != 256"
|   232 | static_assert((IPPROTO_MAX) == (256), "IPPROTO_MAX != 256");

It also adds a patch to regenerate the headers based on the
updated/modified .in files.

Fixes https://git.ostc-eu.org/OSTC/OHOS/meta-ohos/-/issues/102



Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 23938910
No related branches found
No related tags found
No related merge requests found
From 2c721018cc3351ee4518f4f57bbf5b646f96d533 Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Thu, 20 Feb 2020 18:58:27 +0100
Subject: [PATCH 1/1] xlat: update IPPROTO_* constants
* xlat/inet_protocols.in (IPPROTO_MPTCP): New constant, introduced
by Linux kernel commit v5.6-rc1~151^2~118^2~8.
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-status: Backport
---
xlat/inet_protocols.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/xlat/inet_protocols.in b/xlat/inet_protocols.in
index 7e14dc058..5c27821a3 100644
--- a/xlat/inet_protocols.in
+++ b/xlat/inet_protocols.in
@@ -32,3 +32,4 @@ IPPROTO_UDPLITE 136
IPPROTO_MPLS 137
IPPROTO_RAW 255
IPPROTO_MAX 256
+IPPROTO_MPTCP 262
--
2.33.0
From 59ba10cd69b8cf103922b7e9dfff61b0bd846c3c Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Mon, 16 Mar 2020 21:37:50 +0100
Subject: [PATCH 1/1] xlat: add IPPROTO_ETHERNET to inet_protocols
* xlat/inet_protocols.in (IPPROTO_ETHERNET): New constant, introduced
by Linux commit v5.6-rc6~23^2~9.
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-status: Backport
---
xlat/inet_protocols.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/xlat/inet_protocols.in b/xlat/inet_protocols.in
index 5c27821a3..c37508fa3 100644
--- a/xlat/inet_protocols.in
+++ b/xlat/inet_protocols.in
@@ -30,6 +30,7 @@ IPPROTO_SCTP 132
IPPROTO_MH 135
IPPROTO_UDPLITE 136
IPPROTO_MPLS 137
+IPPROTO_ETHERNET 143
IPPROTO_RAW 255
IPPROTO_MAX 256
IPPROTO_MPTCP 262
--
2.33.0
From 2c949e0d82049234f31cd595c6d2097bc9c241de Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Sat, 28 Nov 2020 08:00:00 +0000
Subject: [PATCH 1/1] xlat: remove IPPROTO_MAX
* xlat/inet_protocols.in (IPPROTO_MAX): Remove.
Reported-by: Khem Raj <raj.khem@gmail.com>
Suggested-by: Eugene Syromiatnikov <esyr@redhat.com>
Resolves: https://github.com/strace/strace/issues/164
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-status: Backport
---
xlat/inet_protocols.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/xlat/inet_protocols.in b/xlat/inet_protocols.in
index c37508fa3..89aa56ac4 100644
--- a/xlat/inet_protocols.in
+++ b/xlat/inet_protocols.in
@@ -32,5 +32,4 @@ IPPROTO_UDPLITE 136
IPPROTO_MPLS 137
IPPROTO_ETHERNET 143
IPPROTO_RAW 255
-IPPROTO_MAX 256
IPPROTO_MPTCP 262
--
2.33.0
From 3f86843b300cd4e351da020b70cedfd9bd9101f6 Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Thu, 26 Aug 2021 10:56:47 +0100
Subject: [PATCH] Regenerate xlat headers
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-status: Inappropriate [generated with included script]
---
xlat/inet_protocols.h | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/xlat/inet_protocols.h b/xlat/inet_protocols.h
index 3a32b3c..4659ab4 100644
--- a/xlat/inet_protocols.h
+++ b/xlat/inet_protocols.h
@@ -220,6 +220,13 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define IPPROTO_MPLS 137
#endif
+#if defined(IPPROTO_ETHERNET) || (defined(HAVE_DECL_IPPROTO_ETHERNET) && HAVE_DECL_IPPROTO_ETHERNET)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((IPPROTO_ETHERNET) == (143), "IPPROTO_ETHERNET != 143");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define IPPROTO_ETHERNET 143
+#endif
#if defined(IPPROTO_RAW) || (defined(HAVE_DECL_IPPROTO_RAW) && HAVE_DECL_IPPROTO_RAW)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((IPPROTO_RAW) == (255), "IPPROTO_RAW != 255");
@@ -227,12 +234,12 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define IPPROTO_RAW 255
#endif
-#if defined(IPPROTO_MAX) || (defined(HAVE_DECL_IPPROTO_MAX) && HAVE_DECL_IPPROTO_MAX)
+#if defined(IPPROTO_MPTCP) || (defined(HAVE_DECL_IPPROTO_MPTCP) && HAVE_DECL_IPPROTO_MPTCP)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
-static_assert((IPPROTO_MAX) == (256), "IPPROTO_MAX != 256");
+static_assert((IPPROTO_MPTCP) == (262), "IPPROTO_MPTCP != 262");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
-# define IPPROTO_MAX 256
+# define IPPROTO_MPTCP 262
#endif
#ifndef XLAT_MACROS_ONLY
@@ -271,8 +278,9 @@ static const struct xlat_data inet_protocols_xdata[] = {
XLAT(IPPROTO_MH),
XLAT(IPPROTO_UDPLITE),
XLAT(IPPROTO_MPLS),
+ XLAT(IPPROTO_ETHERNET),
XLAT(IPPROTO_RAW),
- XLAT(IPPROTO_MAX),
+ XLAT(IPPROTO_MPTCP),
};
const struct xlat inet_protocols[1] = { {
.data = inet_protocols_xdata,
--
2.33.0
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
SRC_URI_append = " \
file://0001-xlat-update-IPPROTO_-constants.patch \
file://0002-xlat-add-IPPROTO_ETHERNET-to-inet_protocols.patch \
file://0003-xlat-remove-IPPROTO_MAX.patch \
file://0004-Regenerate-xlat-headers.patch \
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment