MdeModulePkg/RegularExpressionDxe: Fix Arm build error

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>
This commit is contained in:
Nickle Wang 2023-04-21 14:48:30 +08:00 committed by mergify[bot]
parent d226811a66
commit ecbcff0f49
2 changed files with 11 additions and 4 deletions

View File

@ -4,6 +4,7 @@
(C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@ -109,6 +110,7 @@ realloc (
return NULL; return NULL;
} }
#if !defined (MDE_CPU_ARM)
void * void *
memcpy ( memcpy (
void *dest, void *dest,
@ -119,14 +121,16 @@ memcpy (
return CopyMem (dest, src, (UINTN)count); return CopyMem (dest, src, (UINTN)count);
} }
#endif
void * void *
memset ( memset (
void *dest, void *dest,
char ch, int ch,
unsigned int count unsigned int count
) )
{ {
return SetMem (dest, count, ch); return SetMem (dest, (UINTN)count, (UINT8)ch);
} }
void void

View File

@ -4,7 +4,7 @@
(C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@ -107,6 +107,7 @@ realloc (
size_t size size_t size
); );
#if !defined (MDE_CPU_ARM)
void * void *
memcpy ( memcpy (
void *dest, void *dest,
@ -114,10 +115,12 @@ memcpy (
unsigned int count unsigned int count
); );
#endif
void * void *
memset ( memset (
void *dest, void *dest,
char ch, int ch,
unsigned int count unsigned int count
); );