All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] strace: Fix value of IPPROTO_MAX
@ 2020-10-07 20:11 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2020-10-07 20:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

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 <raj.khem@gmail.com>
---
 ...PROTO_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

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..f5632b77fd
--- /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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+Upstream-Status: Submitted [https://lists.strace.io/pipermail/strace-devel/2020-October/thread.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		253
+--- 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) == (253), "IPPROTO_MAX != 253");
+ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+ #else
+-# define IPPROTO_MPTCP 262
++# define IPPROTO_MAX 253
+ #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"
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-07 20:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 20:11 [PATCH] strace: Fix value of IPPROTO_MAX Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.