From 8b0438b5d4850aaca0f725f9ad5d040b90b1347b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 7 Oct 2020 13:19:15 -0700 Subject: strace: Fix value of IPPROTO_MAX This should also fix build with musl ../strace-5.8/xlat/inet_protocols.h:239:1: error: static assertion failed: "IPPROTO_MAX != 256" 239 | static_assert((IPPROTO_MAX) == (256), "IPPROTO_MAX != 256"); | ^~~~~~~~~~~~~ Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- ...rk-IPPROTO_MAX-last-in-IPPROTO_-constants.patch | 70 ++++++++++++++++++++++ meta/recipes-devtools/strace/strace_5.8.bb | 1 + 2 files changed, 71 insertions(+) create mode 100644 meta/recipes-devtools/strace/strace/0001-xlat-Mark-IPPROTO_MAX-last-in-IPPROTO_-constants.patch (limited to 'meta') diff --git a/meta/recipes-devtools/strace/strace/0001-xlat-Mark-IPPROTO_MAX-last-in-IPPROTO_-constants.patch b/meta/recipes-devtools/strace/strace/0001-xlat-Mark-IPPROTO_MAX-last-in-IPPROTO_-constants.patch new file mode 100644 index 0000000000..cd53f33f60 --- /dev/null +++ b/meta/recipes-devtools/strace/strace/0001-xlat-Mark-IPPROTO_MAX-last-in-IPPROTO_-constants.patch @@ -0,0 +1,70 @@ +From 387d3b6fba95cb47c4dacc6bcd330148a9168850 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 7 Oct 2020 12:54:03 -0700 +Subject: [PATCH] xlat: Mark IPPROTO_MAX last in IPPROTO_* constants + +* xlat/inet_protocols.in (IPPROTO_MAX): It should be the last entry + after adding IPPROTO_MPTCP this should have new value as + IPPROTO_MPTCP + 1. + +Signed-off-by: Khem Raj +Upstream-Status: Submitted [https://lists.strace.io/pipermail/strace-devel/2020-October/010253.html] +--- + xlat/inet_protocols.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/xlat/inet_protocols.in ++++ b/xlat/inet_protocols.in +@@ -32,5 +32,5 @@ IPPROTO_UDPLITE 136 + IPPROTO_MPLS 137 + IPPROTO_ETHERNET 143 + IPPROTO_RAW 255 +-IPPROTO_MAX 256 + IPPROTO_MPTCP 262 ++IPPROTO_MAX 263 +--- a/xlat/inet_protocols.h ++++ b/xlat/inet_protocols.h +@@ -234,19 +234,19 @@ 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 +-#if defined(IPPROTO_MPTCP) || (defined(HAVE_DECL_IPPROTO_MPTCP) && HAVE_DECL_IPPROTO_MPTCP) ++#if defined(IPPROTO_MAX) || (defined(HAVE_DECL_IPPROTO_MAX) && HAVE_DECL_IPPROTO_MAX) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +-static_assert((IPPROTO_MPTCP) == (262), "IPPROTO_MPTCP != 262"); ++static_assert((IPPROTO_MAX) == (263), "IPPROTO_MAX != 263"); + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else +-# define IPPROTO_MPTCP 262 ++# define IPPROTO_MAX 263 + #endif + + #ifndef XLAT_MACROS_ONLY +@@ -353,12 +353,12 @@ static const struct xlat_data inet_proto + XLAT(IPPROTO_RAW), + #define XLAT_VAL_32 ((unsigned) (IPPROTO_RAW)) + #define XLAT_STR_32 STRINGIFY(IPPROTO_RAW) +- XLAT(IPPROTO_MAX), +- #define XLAT_VAL_33 ((unsigned) (IPPROTO_MAX)) +- #define XLAT_STR_33 STRINGIFY(IPPROTO_MAX) + XLAT(IPPROTO_MPTCP), +- #define XLAT_VAL_34 ((unsigned) (IPPROTO_MPTCP)) +- #define XLAT_STR_34 STRINGIFY(IPPROTO_MPTCP) ++ #define XLAT_VAL_33 ((unsigned) (IPPROTO_MPTCP)) ++ #define XLAT_STR_33 STRINGIFY(IPPROTO_MPTCP) ++ XLAT(IPPROTO_MAX), ++ #define XLAT_VAL_34 ((unsigned) (IPPROTO_MAX)) ++ #define XLAT_STR_34 STRINGIFY(IPPROTO_MAX) + }; + const struct xlat inet_protocols[1] = { { + .data = inet_protocols_xdata, diff --git a/meta/recipes-devtools/strace/strace_5.8.bb b/meta/recipes-devtools/strace/strace_5.8.bb index 70d5940f60..0415588b97 100644 --- a/meta/recipes-devtools/strace/strace_5.8.bb +++ b/meta/recipes-devtools/strace/strace_5.8.bb @@ -14,6 +14,7 @@ SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \ file://ptest-spacesave.patch \ file://uintptr_t.patch \ file://0001-strace-fix-reproducibilty-issues.patch \ + file://0001-xlat-Mark-IPPROTO_MAX-last-in-IPPROTO_-constants.patch \ " SRC_URI[sha256sum] = "df4a669f7fff9cc302784085bd4b72fab216a426a3f72c892b28a537b71e7aa9" -- cgit 1.2.3-korg