Openembedded Core Discussions
 help / color / mirror / Atom feed
From: sunilkumar.dora@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: raj.khem@gmail.com, randy.macleod@windriver.com,
	sundeep.kokkonda@windriver.com, deepesh.vatharaj@windriver.com
Subject: [PATCH 08/11] ovmf: Fix memcpy alias prototype for clang 23
Date: Sun, 30 Aug 2026 18:28:48 +0530	[thread overview]
Message-ID: <20260830125853.1139807-9-sunilkumar.dora@windriver.com> (raw)
In-Reply-To: <20260830125853.1139807-1-sunilkumar.dora@windriver.com>

From: Sunil Dora <sunilkumar.dora@windriver.com>

The memcpy alias in CryptoPkg's IntrinsicLib declares its size
parameter as unsigned int while the aliasee uses size_t. clang 23
diagnoses that through the new -Wattribute-alias, which the CLANGDWARF
build's -Werror turns into

  CopyMem.c:29:17: error: alias and aliasee have different types
  'void *(void *, const void *, unsigned int)' and
  'void *(void *, const void *, size_t)' [-Werror,-Wattribute-alias]

Declare the alias with size_t to match.

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 ...sicLib-fix-memcpy-alias-prototype-fo.patch | 35 +++++++++++++++++++
 meta/recipes-core/ovmf/ovmf_git.bb            |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-core/ovmf/ovmf/0005-CryptoPkg-IntrinsicLib-fix-memcpy-alias-prototype-fo.patch

diff --git a/meta/recipes-core/ovmf/ovmf/0005-CryptoPkg-IntrinsicLib-fix-memcpy-alias-prototype-fo.patch b/meta/recipes-core/ovmf/ovmf/0005-CryptoPkg-IntrinsicLib-fix-memcpy-alias-prototype-fo.patch
new file mode 100644
index 0000000000..0921f21347
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0005-CryptoPkg-IntrinsicLib-fix-memcpy-alias-prototype-fo.patch
@@ -0,0 +1,35 @@
+From: Sunil Dora <sunilkumar.dora@windriver.com>
+Date: Wed, 20 Aug 2026 10:45:00 +0530
+Subject: [PATCH] CryptoPkg/IntrinsicLib: fix memcpy alias prototype for clang
+
+The clang-only memcpy alias declares its size parameter as unsigned int
+while the __memcpy aliasee uses size_t (UINTN, unsigned long long on
+X64). clang 23 diagnoses mismatched alias/aliasee types via the new
+-Wattribute-alias warning, which the CLANGDWARF build's -Werror turns
+into a hard error:
+
+  CopyMem.c:29:17: error: alias and aliasee have different types
+  'void *(void *, const void *, unsigned int)' and
+  'void *(void *, const void *, size_t)' [-Werror,-Wattribute-alias]
+
+Declare the alias with size_t, matching the aliasee on every
+architecture (UINTN is unsigned int on IA32, unsigned long long on X64).
+
+Upstream-Status: Submitted [https://github.com/tianocore/edk2/pull/13038]
+Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
+---
+--- a/CryptoPkg/Library/IntrinsicLib/CopyMem.c
++++ b/CryptoPkg/Library/IntrinsicLib/CopyMem.c
+@@ -29,9 +29,9 @@
+ __attribute__ ((__alias__ ("__memcpy")))
+ void *
+ memcpy (
+-  void          *dest,
+-  const void    *src,
+-  unsigned int  count
++  void        *dest,
++  const void  *src,
++  size_t      count
+   );
+ 
+ #else
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 660aefcf46..bf69108f0a 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -19,6 +19,7 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;ta
            file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
            file://0003-debug-prefix-map.patch \
            file://0004-reproducible.patch \
+           file://0005-CryptoPkg-IntrinsicLib-fix-memcpy-alias-prototype-fo.patch \
            "
 
 PV = "edk2-stable202605"
-- 
2.43.0



  parent reply	other threads:[~2026-08-30 12:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30 12:58 [PATCH 00/11] clang/llvm: Upgrade to 23.1.0 sunilkumar.dora
2026-08-30 12:58 ` [PATCH 01/11] clang/llvm: Upgrade to 23.1.0 release sunilkumar.dora
2026-08-30 19:53   ` Khem Raj
2026-09-01  3:37     ` [OE-core] " Dora, Sunil Kumar
2026-09-01 12:49       ` Richard Purdie
2026-08-30 12:58 ` [PATCH 02/11] spirv-llvm-translator: Upgrade to 23.1.0 sunilkumar.dora
2026-08-30 19:43   ` Khem Raj
2026-09-01  4:07     ` [OE-core] " Dora, Sunil Kumar
2026-08-30 12:58 ` [PATCH 03/11] openmp: Build via the LLVM runtimes entry point sunilkumar.dora
2026-08-30 19:45   ` Khem Raj
2026-09-01  4:33     ` [OE-core] " Dora, Sunil Kumar
2026-09-03  1:11       ` Khem Raj
2026-08-30 12:58 ` [PATCH 04/11] rust: Fix build and oe-selftest failures with LLVM 23 sunilkumar.dora
2026-08-30 19:47   ` Khem Raj
2026-09-01  5:17     ` [OE-core] " Dora, Sunil Kumar
2026-09-03  1:08       ` Khem Raj
2026-08-30 12:58 ` [PATCH 05/11] rust: Do not pass the removed x86 amx-tf32 feature to " sunilkumar.dora
2026-08-30 12:58 ` [PATCH 06/11] clang: Disable clangd's decision-forest completion model on powerpc sunilkumar.dora
2026-08-30 12:58 ` [PATCH 07/11] pango: Don't turn clang 23's -Wunused-but-set-global into an error sunilkumar.dora
2026-08-30 12:58 ` sunilkumar.dora [this message]
2026-08-30 12:58 ` [PATCH 09/11] vulkan-samples: Don't turn clang 23's -Wdangling-gsl " sunilkumar.dora
2026-08-30 12:58 ` [PATCH 10/11] gettext: Export a fully-flagged Objective-C compiler sunilkumar.dora
2026-08-30 12:58 ` [PATCH 11/11] clang/llvm: Ignore tests fail with clang/llvm 23 upgrade sunilkumar.dora
2026-08-30 19:53 ` [PATCH 00/11] clang/llvm: Upgrade to 23.1.0 Khem Raj
2026-09-01  4:59   ` [OE-core] " Dora, Sunil Kumar
2026-09-03  1:10     ` Khem Raj
2026-09-03 23:46       ` Khem Raj
2026-09-04  4:49         ` Dora, Sunil Kumar
2026-09-05 13:26           ` Dora, Sunil Kumar
2026-09-05 18:01             ` [OE-core] " Khem Raj

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=20260830125853.1139807-9-sunilkumar.dora@windriver.com \
    --to=sunilkumar.dora@windriver.com \
    --cc=deepesh.vatharaj@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    --cc=randy.macleod@windriver.com \
    --cc=sundeep.kokkonda@windriver.com \
    /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