]> xenbits.xensource.com Git - ovmf.git/commitdiff
MdeModulePkg/RegularExpressionDxe: Fix Arm build error
authorNickle Wang <nicklew@nvidia.com>
Fri, 21 Apr 2023 06:48:30 +0000 (14:48 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 28 Apr 2023 08:55:56 +0000 (08:55 +0000)
Arm CI build error:
- ArmPkg/Library/CompilerIntrinsicsLib/memset.c:39:1: warning: type of
‘memset’ does not match original declaration [-Wlto-type-mismatch]
MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c:123:1:
note: type ‘char’ should match type ‘int’
- multiple definition of `memcpy'; OnigurumaUefiPort.obj (symbol from
plugin):(.text+0x0): first defined here

Fix:
- Update memset() implementation to match memset() definition in
ArmPkg/Library/CompilerIntrinsicsLib.
- memcpy() is supported by ArmPkg/Library/CompilerIntrinsicsLib. Exclude
it in OnigurumaUefiPort.c.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h

index 6661c67f976efe183cfa127897abf81e2d52dd17..0d8984dde091526960eb706ae226e1ebc6d9a6c4 100644 (file)
@@ -4,6 +4,7 @@
 \r
   (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>\r
   Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
@@ -109,6 +110,7 @@ realloc (
   return NULL;\r
 }\r
 \r
+#if !defined (MDE_CPU_ARM)\r
 void *\r
 memcpy (\r
   void          *dest,\r
@@ -119,14 +121,16 @@ memcpy (
   return CopyMem (dest, src, (UINTN)count);\r
 }\r
 \r
+#endif\r
+\r
 void *\r
 memset (\r
   void          *dest,\r
-  char          ch,\r
+  int           ch,\r
   unsigned int  count\r
   )\r
 {\r
-  return SetMem (dest, count, ch);\r
+  return SetMem (dest, (UINTN)count, (UINT8)ch);\r
 }\r
 \r
 void\r
index 248109b0c96eb162955aedb61304e4ebc5885e09..8931f8ec50a95ac2bc47204bbf2cbc9217dea6a0 100644 (file)
@@ -4,7 +4,7 @@
 \r
   (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>\r
   Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
-  Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\r
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
@@ -107,6 +107,7 @@ realloc (
   size_t  size\r
   );\r
 \r
+#if !defined (MDE_CPU_ARM)\r
 void *\r
 memcpy (\r
   void          *dest,\r
@@ -114,10 +115,12 @@ memcpy (
   unsigned int  count\r
   );\r
 \r
+#endif\r
+\r
 void *\r
 memset (\r
   void          *dest,\r
-  char          ch,\r
+  int           ch,\r
   unsigned int  count\r
   );\r
 \r