* [PATCH v2 1/1] MdeModulePkg/RegularExpressionDxe: Fix Arm build error
@ 2023-04-27 10:17 Nickle Wang
2023-04-28 5:12 ` 回复: [edk2-devel] " gaoliming
0 siblings, 1 reply; 2+ messages in thread
From: Nickle Wang @ 2023-04-27 10:17 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao, Michael D Kinney, Nick Ramirez
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>
---
.../Universal/RegularExpressionDxe/OnigurumaUefiPort.h | 7 +++++--
.../Universal/RegularExpressionDxe/OnigurumaUefiPort.c | 8 ++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
index 248109b0c96e..8931f8ec50a9 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
@@ -4,7 +4,7 @@
(C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<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
**/
@@ -107,6 +107,7 @@ realloc (
size_t size
);
+#if !defined (MDE_CPU_ARM)
void *
memcpy (
void *dest,
@@ -114,10 +115,12 @@ memcpy (
unsigned int count
);
+#endif
+
void *
memset (
void *dest,
- char ch,
+ int ch,
unsigned int count
);
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
index 6661c67f976e..0d8984dde091 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
@@ -4,6 +4,7 @@
(C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP<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
**/
@@ -109,6 +110,7 @@ realloc (
return NULL;
}
+#if !defined (MDE_CPU_ARM)
void *
memcpy (
void *dest,
@@ -119,14 +121,16 @@ memcpy (
return CopyMem (dest, src, (UINTN)count);
}
+#endif
+
void *
memset (
void *dest,
- char ch,
+ int ch,
unsigned int count
)
{
- return SetMem (dest, count, ch);
+ return SetMem (dest, (UINTN)count, (UINT8)ch);
}
void
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* 回复: [edk2-devel] [PATCH v2 1/1] MdeModulePkg/RegularExpressionDxe: Fix Arm build error
2023-04-27 10:17 [PATCH v2 1/1] MdeModulePkg/RegularExpressionDxe: Fix Arm build error Nickle Wang
@ 2023-04-28 5:12 ` gaoliming
0 siblings, 0 replies; 2+ messages in thread
From: gaoliming @ 2023-04-28 5:12 UTC (permalink / raw)
To: devel, nicklew
Cc: 'Jian J Wang', 'Michael D Kinney',
'Nick Ramirez'
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Nickle Wang
> via groups.io
> 发送时间: 2023年4月27日 18:18
> 收件人: devel@edk2.groups.io
> 抄送: Jian J Wang <jian.j.wang@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Michael D Kinney
> <michael.d.kinney@intel.com>; Nick Ramirez <nramirez@nvidia.com>
> 主题: [edk2-devel] [PATCH v2 1/1] 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>
> ---
> .../Universal/RegularExpressionDxe/OnigurumaUefiPort.h | 7 +++++--
> .../Universal/RegularExpressionDxe/OnigurumaUefiPort.c | 8 ++++++--
> 2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git
> a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
> b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
> index 248109b0c96e..8931f8ec50a9 100644
> --- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
> +++
> b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
> @@ -4,7 +4,7 @@
>
> (C) Copyright 2014-2021 Hewlett Packard Enterprise Development
> LP<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
> **/
> @@ -107,6 +107,7 @@ realloc (
> size_t size
> );
>
> +#if !defined (MDE_CPU_ARM)
> void *
> memcpy (
> void *dest,
> @@ -114,10 +115,12 @@ memcpy (
> unsigned int count
> );
>
> +#endif
> +
> void *
> memset (
> void *dest,
> - char ch,
> + int ch,
> unsigned int count
> );
>
> diff --git
> a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
> b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
> index 6661c67f976e..0d8984dde091 100644
> --- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
> +++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
> @@ -4,6 +4,7 @@
>
> (C) Copyright 2014-2021 Hewlett Packard Enterprise Development
> LP<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
> **/
> @@ -109,6 +110,7 @@ realloc (
> return NULL;
> }
>
> +#if !defined (MDE_CPU_ARM)
> void *
> memcpy (
> void *dest,
> @@ -119,14 +121,16 @@ memcpy (
> return CopyMem (dest, src, (UINTN)count);
> }
>
> +#endif
> +
> void *
> memset (
> void *dest,
> - char ch,
> + int ch,
> unsigned int count
> )
> {
> - return SetMem (dest, count, ch);
> + return SetMem (dest, (UINTN)count, (UINT8)ch);
> }
>
> void
> --
> 2.17.1
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-28 5:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-27 10:17 [PATCH v2 1/1] MdeModulePkg/RegularExpressionDxe: Fix Arm build error Nickle Wang
2023-04-28 5:12 ` 回复: [edk2-devel] " gaoliming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox