mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Christian Melki <christian.melki@t2data.com>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] efivar: Version bump 37 -> 38.
Date: Fri, 28 Jan 2022 11:17:31 +0100	[thread overview]
Message-ID: <YfPCu+CVOCBso6ws@pengutronix.de> (raw)
In-Reply-To: <20220127143532.2212796-2-christian.melki@t2data.com>

On Thu, Jan 27, 2022 at 03:35:21PM +0100, Christian Melki wrote:
> Contains approx 2 years worth of fixes, including a lot
> of compile error fixes. So drop old patchset.

Fails to build on ARM:

esl-iter.c:316:3: note: in expansion of macro 'efi_error'
esl-iter.c:338:45: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'long unsigned int' [-Werror=format=]
esl-iter.c:363:45: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'long unsigned int' [-Werror=format=]
esl-iter.c:414:44: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'long unsigned int' [-Werror=format=]

.. and others.

I think adding ERRORS="-Wno-error" to EFIVAR_MAKE_ENV should help. That
should disable the -Werror and the warning are not a problem.

Michael

> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  ..._guid-handle-misaligned-guid-pointer.patch |  55 ------
>  ...es-Werror-address-of-packed-member-c.patch | 167 ------------------
>  patches/efivar-37/series                      |   5 -
>  rules/efivar.make                             |   4 +-
>  4 files changed, 2 insertions(+), 229 deletions(-)
>  delete mode 100644 patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
>  delete mode 100644 patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
>  delete mode 100644 patches/efivar-37/series
> 
> diff --git a/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch b/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
> deleted file mode 100644
> index 89e913a74..000000000
> --- a/patches/efivar-37/0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -From: Peter Jones <pjones@redhat.com>
> -Date: Mon, 7 Jan 2019 10:30:59 -0500
> -Subject: [PATCH] dp.h: make format_guid() handle misaligned guid pointers
> - safely.
> -
> -GCC 9 adds -Werror=address-of-packed-member, which causes us to see the
> -build error reported at
> - https://bugzilla.opensuse.org/show_bug.cgi?id=1120862 .
> -
> -That bug report shows us the following:
> -
> -In file included from dp.c:26:
> -dp.h: In function 'format_vendor_helper':
> -dp.h:120:37: error: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Werror=address-of-packed-member]
> -  120 |  format_guid(buf, size, off, label, &dp->hw_vendor.vendor_guid);
> -      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
> -dp.h:74:25: note: in definition of macro 'format_guid'
> -   74 |   _rc = efi_guid_to_str(guid, &_guidstr);   \
> -      |                         ^~~~
> -cc1: all warnings being treated as errors
> -
> -This patch makes format_guid() use a local variable as a bounce buffer
> -in the case that the guid we're passed is aligned as chaotic neutral.
> -
> -Note that this only fixes this instance and there may be others that bz
> -didn't show because it exited too soon, and I don't have a gcc 9 build
> -in front of me right now.
> -
> -Signed-off-by: Peter Jones <pjones@redhat.com>
> ----
> - src/dp.h | 11 +++++++++--
> - 1 file changed, 9 insertions(+), 2 deletions(-)
> -
> -diff --git a/src/dp.h b/src/dp.h
> -index aa4e3902992d..20cb608d05f7 100644
> ---- a/src/dp.h
> -+++ b/src/dp.h
> -@@ -70,8 +70,15 @@
> - #define format_guid(buf, size, off, dp_type, guid) ({			\
> - 		int _rc;						\
> - 		char *_guidstr = NULL;					\
> --									\
> --		_rc = efi_guid_to_str(guid, &_guidstr);			\
> -+		efi_guid_t _guid;					\
> -+		const efi_guid_t * const _guid_p =			\
> -+			likely(__alignof__(guid) == sizeof(guid))	\
> -+				? guid					\
> -+				: &_guid;				\
> -+								        \
> -+		if (unlikely(__alignof__(guid) == sizeof(guid)))	\
> -+			memmove(&_guid, guid, sizeof(_guid));		\
> -+		_rc = efi_guid_to_str(_guid_p, &_guidstr);		\
> - 		if (_rc < 0) {						\
> - 			efi_error("could not build %s GUID DP string",	\
> - 				  dp_type);				\
> diff --git a/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch b/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
> deleted file mode 100644
> index 7653bd80a..000000000
> --- a/patches/efivar-37/0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
> +++ /dev/null
> @@ -1,167 +0,0 @@
> -From: Peter Jones <pjones@redhat.com>
> -Date: Thu, 21 Feb 2019 15:20:12 -0500
> -Subject: [PATCH] Fix all the places -Werror=address-of-packed-member catches.
> -
> -This gets rid of all the places GCC 9's -Werror=address-of-packed-member
> -flags as problematic.
> -
> -Fixes github issue #123
> -
> -Signed-off-by: Peter Jones <pjones@redhat.com>
> ----
> - src/dp-message.c            |  6 ++++--
> - src/dp.h                    | 12 ++++--------
> - src/guid.c                  |  2 +-
> - src/include/efivar/efivar.h |  2 +-
> - src/ucs2.h                  | 27 +++++++++++++++++++--------
> - 5 files changed, 29 insertions(+), 20 deletions(-)
> -
> -diff --git a/src/dp-message.c b/src/dp-message.c
> -index 3724e5f57bdb..9f964663de86 100644
> ---- a/src/dp-message.c
> -+++ b/src/dp-message.c
> -@@ -620,11 +620,13 @@ _format_message_dn(char *buf, size_t size, const_efidp dp)
> - 			  ) / sizeof(efi_ip_addr_t);
> - 		format(buf, size, off, "Dns", "Dns(");
> - 		for (int i=0; i < end; i++) {
> --			const efi_ip_addr_t *addr = &dp->dns.addrs[i];
> -+			efi_ip_addr_t addr;
> -+
> -+			memcpy(&addr, &dp->dns.addrs[i], sizeof(addr));
> - 			if (i != 0)
> - 				format(buf, size, off, "Dns", ",");
> - 			format_ip_addr(buf, size, off, "Dns",
> --				       dp->dns.is_ipv6, addr);
> -+				       dp->dns.is_ipv6, &addr);
> - 		}
> - 		format(buf, size, off, "Dns", ")");
> - 		break;
> -diff --git a/src/dp.h b/src/dp.h
> -index 20cb608d05f7..1f921d524aaf 100644
> ---- a/src/dp.h
> -+++ b/src/dp.h
> -@@ -71,13 +71,9 @@
> - 		int _rc;						\
> - 		char *_guidstr = NULL;					\
> - 		efi_guid_t _guid;					\
> --		const efi_guid_t * const _guid_p =			\
> --			likely(__alignof__(guid) == sizeof(guid))	\
> --				? guid					\
> --				: &_guid;				\
> --								        \
> --		if (unlikely(__alignof__(guid) == sizeof(guid)))	\
> --			memmove(&_guid, guid, sizeof(_guid));		\
> -+		const efi_guid_t * const _guid_p = &_guid;		\
> -+									\
> -+		memmove(&_guid, guid, sizeof(_guid));			\
> - 		_rc = efi_guid_to_str(_guid_p, &_guidstr);		\
> - 		if (_rc < 0) {						\
> - 			efi_error("could not build %s GUID DP string",	\
> -@@ -86,7 +82,7 @@
> - 			_guidstr = onstack(_guidstr,			\
> - 					   strlen(_guidstr)+1);		\
> - 			_rc = format(buf, size, off, dp_type, "%s",	\
> --				     _guidstr);	\
> -+				     _guidstr);				\
> - 		}							\
> - 		_rc;							\
> - 	})
> -diff --git a/src/guid.c b/src/guid.c
> -index 306c9ff8287c..3156b3b7c60a 100644
> ---- a/src/guid.c
> -+++ b/src/guid.c
> -@@ -31,7 +31,7 @@
> - extern const efi_guid_t efi_guid_zero;
> - 
> - int NONNULL(1, 2) PUBLIC
> --efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b)
> -+efi_guid_cmp(const void * const a, const void * const b)
> - {
> - 	return memcmp(a, b, sizeof (efi_guid_t));
> - }
> -diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
> -index 316891ccae9c..ad6449d9d938 100644
> ---- a/src/include/efivar/efivar.h
> -+++ b/src/include/efivar/efivar.h
> -@@ -128,7 +128,7 @@ extern int efi_symbol_to_guid(const char *symbol, efi_guid_t *guid)
> - 
> - extern int efi_guid_is_zero(const efi_guid_t *guid);
> - extern int efi_guid_is_empty(const efi_guid_t *guid);
> --extern int efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b);
> -+extern int efi_guid_cmp(const void * const a, const void * const b);
> - 
> - /* import / export functions */
> - typedef struct efi_variable efi_variable_t;
> -diff --git a/src/ucs2.h b/src/ucs2.h
> -index dbb59004b7c0..edd8367b4bcc 100644
> ---- a/src/ucs2.h
> -+++ b/src/ucs2.h
> -@@ -23,16 +23,21 @@
> - 	(((val) & ((mask) << (shift))) >> (shift))
> - 
> - static inline size_t UNUSED
> --ucs2len(const uint16_t * const s, ssize_t limit)
> -+ucs2len(const void *vs, ssize_t limit)
> - {
> - 	ssize_t i;
> --	for (i = 0; i < (limit >= 0 ? limit : i+1) && s[i] != (uint16_t)0; i++)
> -+	const uint16_t *s = vs;
> -+	const uint8_t *s8 = vs;
> -+
> -+	for (i = 0;
> -+	     i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
> -+	     i++, s8 += 2, s++)
> - 		;
> - 	return i;
> - }
> - 
> - static inline size_t UNUSED
> --ucs2size(const uint16_t * const s, ssize_t limit)
> -+ucs2size(const void *s, ssize_t limit)
> - {
> - 	size_t rc = ucs2len(s, limit);
> - 	rc *= sizeof (uint16_t);
> -@@ -69,10 +74,11 @@ utf8size(uint8_t *s, ssize_t limit)
> - }
> - 
> - static inline unsigned char * UNUSED
> --ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
> -+ucs2_to_utf8(const void * const voidchars, ssize_t limit)
> - {
> - 	ssize_t i, j;
> - 	unsigned char *ret;
> -+	const uint16_t * const chars = voidchars;
> - 
> - 	if (limit < 0)
> - 		limit = ucs2len(chars, -1);
> -@@ -124,10 +130,12 @@ ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
> - }
> - 
> - static inline ssize_t UNUSED NONNULL(4)
> --utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8)
> -+utf8_to_ucs2(void *ucs2void, ssize_t size, int terminate, uint8_t *utf8)
> - {
> - 	ssize_t req;
> - 	ssize_t i, j;
> -+	uint16_t *ucs2 = ucs2void;
> -+	uint16_t val16;
> - 
> - 	if (!ucs2 && size > 0) {
> - 		errno = EINVAL;
> -@@ -162,10 +170,13 @@ utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8)
> - 			val = utf8[i] & 0x7f;
> - 			i += 1;
> - 		}
> --		ucs2[j] = val;
> -+		val16 = val;
> -+		ucs2[j] = val16;
> -+	}
> -+	if (terminate) {
> -+		val16 = 0;
> -+		ucs2[j++] = val16;
> - 	}
> --	if (terminate)
> --		ucs2[j++] = (uint16_t)0;
> - 	return j;
> - };
> - 
> diff --git a/patches/efivar-37/series b/patches/efivar-37/series
> deleted file mode 100644
> index e6f14fec2..000000000
> --- a/patches/efivar-37/series
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -# generated by git-ptx-patches
> -#tag:base --start-number 1
> -0001-dp.h-make-format_guid-handle-misaligned-guid-pointer.patch
> -0002-Fix-all-the-places-Werror-address-of-packed-member-c.patch
> -# cbb8f240dc2a442323107d34454fa178  - git-ptx-patches magic
> diff --git a/rules/efivar.make b/rules/efivar.make
> index db0ed001f..3d088b01c 100644
> --- a/rules/efivar.make
> +++ b/rules/efivar.make
> @@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_EFIVAR) += efivar
>  #
>  # Paths and names
>  #
> -EFIVAR_VERSION	:= 37
> -EFIVAR_MD5	:= 9f067275c5f7aafdd75bfb364280ac9c
> +EFIVAR_VERSION	:= 38
> +EFIVAR_MD5	:= 243fdbc48440212695cb9c6e6fd0f44f
>  EFIVAR		:= efivar-$(EFIVAR_VERSION)
>  EFIVAR_SUFFIX	:= tar.bz2
>  EFIVAR_URL	:= https://github.com/rhboot/efivar/releases/download/$(EFIVAR_VERSION)/$(EFIVAR).$(EFIVAR_SUFFIX)
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


  reply	other threads:[~2022-01-28 10:17 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 14:35 [ptxdist] [PATCH] wpa_supplicant: Version bump 2.9 -> 2.10 Christian Melki
2022-01-27 14:35 ` [ptxdist] [PATCH] efivar: Version bump 37 -> 38 Christian Melki
2022-01-28 10:17   ` Michael Olbrich [this message]
2022-01-27 14:35 ` [ptxdist] [PATCH] sysklogd: Version bump. 2.2.3 -> 2.3.0 Christian Melki
2022-01-30 15:49   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] dump1090fa: Version bump 6.1 -> 7.1 Christian Melki
2022-01-27 15:56   ` Bruno Thomsen
2022-01-27 16:31     ` Christian Melki
2022-01-28  9:37       ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] chrony: Version bump. 4.1 -> 4.2 Christian Melki
2022-01-30 15:49   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] strace: Version bump. 5.15 -> 5.16 Christian Melki
2022-01-28  9:19   ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] alsa-lib: Version bump 1.2.5.1 -> 1.2.6.1 Christian Melki
2022-01-30 15:49   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] alsa-utils: Version bump 1.2.5.1 -> 1.2.6 Christian Melki
2022-01-30 15:49   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] libsndfile: Version bump 1.0.25 -> 1.0.31 Christian Melki
2022-01-28 12:46   ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [WIP: PATCH] pps-tools: Version bump. 1.0.2 -> 1.0.3 Christian Melki
2022-01-28  9:26   ` Michael Olbrich
2022-01-28  9:39     ` Christian Melki
2022-01-28 10:36       ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] tpm2-tss: Version bump. 2.3.1 -> 3.1.0 Christian Melki
2022-01-28 16:16   ` Michael Olbrich
2022-01-28 17:22     ` Christian Melki
2022-01-28 18:32       ` Michael Olbrich
2022-01-29  8:29         ` Christian Melki
2022-01-29 15:36           ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] tpm2-tools: Version bump. 4.1 -> 5.2 Christian Melki
2022-01-27 15:54   ` Bruno Thomsen
2022-01-28  9:31     ` Michael Olbrich
2022-01-28 13:33       ` Christian Melki
2022-01-28 14:56         ` Michael Olbrich
2022-01-27 14:35 ` [ptxdist] [PATCH] ncurses: Version bump. 6.2 -> 6.3 Christian Melki
2022-01-30 15:49   ` [ptxdist] [APPLIED] " Michael Olbrich
2022-01-30 15:49 ` [ptxdist] [APPLIED] wpa_supplicant: Version bump 2.9 -> 2.10 Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfPCu+CVOCBso6ws@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox