public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg
@ 2023-07-22  1:06 Michael D Kinney
  2023-07-22  1:06 ` [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error Michael D Kinney
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Michael D Kinney @ 2023-07-22  1:06 UTC (permalink / raw)
  To: devel
  Cc: Gerd Hoffmann, Rebecca Cran, Liming Gao, Zhiguang Liu,
	Andrew Fish, Ray Ni

Remove RUNTIME_FUNCTION redefinition error workaround from
the following commit to the MdePkg that only impacts EmulatorPkg
builds that uses windows include files:

https://github.com/tianocore/edk2/commit/ff52068d9261b9391d75b83a2a4e40e040f3b6eb

The correct location for this fix is in the EmulatorPkg
in the WinInclude.h file that addresses all the name
collisions between edk2 types and windows types.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney michael.d.kinney@intel.com

Michael D Kinney (2):
  EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
  MdePkg/Include/IndustryStandard: Remove VS20xx workaround

 EmulatorPkg/Win/Host/WinInclude.h         | 10 ++++++----
 MdePkg/Include/IndustryStandard/PeImage.h |  5 -----
 2 files changed, 6 insertions(+), 9 deletions(-)

-- 
2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107136): https://edk2.groups.io/g/devel/message/107136
Mute This Topic: https://groups.io/mt/100288520/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
  2023-07-22  1:06 [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg Michael D Kinney
@ 2023-07-22  1:06 ` Michael D Kinney
  2023-07-24  1:56   ` Ni, Ray
  2023-07-22  1:06 ` [edk2-devel] [Patch 2/2] MdePkg/Include/IndustryStandard: Remove VS20xx workaround Michael D Kinney
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Michael D Kinney @ 2023-07-22  1:06 UTC (permalink / raw)
  To: devel; +Cc: Gerd Hoffmann, Rebecca Cran, Andrew Fish, Ray Ni

Update WinInclude.h to prevent error due to redefinition of
RUNTIME_FUNCTION using same technique that has been used
in the past for structure types such as LIST_ENTRY.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 EmulatorPkg/Win/Host/WinInclude.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/EmulatorPkg/Win/Host/WinInclude.h b/EmulatorPkg/Win/Host/WinInclude.h
index c2b6cfa3d658..877d2b0ed016 100644
--- a/EmulatorPkg/Win/Host/WinInclude.h
+++ b/EmulatorPkg/Win/Host/WinInclude.h
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 //
 // Win32 include files do not compile clean with /W4, so we use the warning
-// pragma to suppress the warnings for Win32 only. This way our code can stil
+// pragma to suppress the warnings for Win32 only. This way our code can still
 // compile at /W4 (highest warning level) with /WX (warnings cause build
 // errors).
 //
@@ -19,9 +19,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #pragma warning(disable : 4028)
 #pragma warning(disable : 4133)
 
-#define GUID         _WINNT_DUP_GUID_____
-#define _LIST_ENTRY  _WINNT_DUP_LIST_ENTRY_FORWARD
-#define LIST_ENTRY   _WINNT_DUP_LIST_ENTRY
+#define GUID              _WINNT_DUP_GUID_____
+#define _LIST_ENTRY       _WINNT_DUP_LIST_ENTRY_FORWARD
+#define LIST_ENTRY        _WINNT_DUP_LIST_ENTRY
+#define RUNTIME_FUNCTION  _WINNT_DUP_RUNTIME_FUNCTION
 #if defined (MDE_CPU_IA32) && (_MSC_VER < 1800)
 #define InterlockedIncrement          _WINNT_DUP_InterlockedIncrement
 #define InterlockedDecrement          _WINNT_DUP_InterlockedDecrement
@@ -45,6 +46,7 @@ typedef UINT32 size_t;
 #undef GUID
 #undef _LIST_ENTRY
 #undef LIST_ENTRY
+#undef RUNTIME_FUNCTION
 #undef InterlockedIncrement
 #undef InterlockedDecrement
 #undef InterlockedCompareExchange64
-- 
2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107137): https://edk2.groups.io/g/devel/message/107137
Mute This Topic: https://groups.io/mt/100288521/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [edk2-devel] [Patch 2/2] MdePkg/Include/IndustryStandard: Remove VS20xx workaround
  2023-07-22  1:06 [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg Michael D Kinney
  2023-07-22  1:06 ` [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error Michael D Kinney
@ 2023-07-22  1:06 ` Michael D Kinney
  2023-07-24  1:09 ` [edk2-devel] 回复: [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg gaoliming via groups.io
  2023-07-24  1:11 ` [edk2-devel] " Rebecca Cran
  3 siblings, 0 replies; 6+ messages in thread
From: Michael D Kinney @ 2023-07-22  1:06 UTC (permalink / raw)
  To: devel; +Cc: Gerd Hoffmann, Rebecca Cran, Liming Gao, Zhiguang Liu

Remove workaround for the redefinition of the type
RUNTIME_FUNCTION that is generated when building with
VS20xx tool chains and using windows include files.
The correct location for this fix is in the EmulatorPkg
in the WinInclude.h file that addresses all the name
collisions between edk2 types and windows types.

The commit that added the workaround is:

https://github.com/tianocore/edk2/commit/ff52068d9261b9391d75b83a2a4e40e040f3b6eb

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdePkg/Include/IndustryStandard/PeImage.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/PeImage.h b/MdePkg/Include/IndustryStandard/PeImage.h
index 47037049348c..4840b8dd8a9e 100644
--- a/MdePkg/Include/IndustryStandard/PeImage.h
+++ b/MdePkg/Include/IndustryStandard/PeImage.h
@@ -678,9 +678,6 @@ typedef struct {
   //
 } EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
 
-// avoid conflict with windows header files
-#ifndef RUNTIME_FUNCTION_INDIRECT
-
 //
 // .pdata entries for X64
 //
@@ -690,8 +687,6 @@ typedef struct {
   UINT32    UnwindInfoAddress;
 } RUNTIME_FUNCTION;
 
-#endif
-
 typedef struct {
   UINT8    Version             : 3;
   UINT8    Flags               : 5;
-- 
2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107138): https://edk2.groups.io/g/devel/message/107138
Mute This Topic: https://groups.io/mt/100288522/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [edk2-devel] 回复: [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg
  2023-07-22  1:06 [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg Michael D Kinney
  2023-07-22  1:06 ` [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error Michael D Kinney
  2023-07-22  1:06 ` [edk2-devel] [Patch 2/2] MdePkg/Include/IndustryStandard: Remove VS20xx workaround Michael D Kinney
@ 2023-07-24  1:09 ` gaoliming via groups.io
  2023-07-24  1:11 ` [edk2-devel] " Rebecca Cran
  3 siblings, 0 replies; 6+ messages in thread
From: gaoliming via groups.io @ 2023-07-24  1:09 UTC (permalink / raw)
  To: 'Michael D Kinney', devel
  Cc: 'Gerd Hoffmann', 'Rebecca Cran',
	'Zhiguang Liu', 'Andrew Fish', 'Ray Ni'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Michael D Kinney <michael.d.kinney@intel.com>
> 发送时间: 2023年7月22日 9:06
> 收件人: devel@edk2.groups.io
> 抄送: Gerd Hoffmann <kraxel@redhat.com>; Rebecca Cran
> <rebecca@bsdio.com>; Liming Gao <gaoliming@byosoft.com.cn>; Zhiguang
> Liu <zhiguang.liu@intel.com>; Andrew Fish <afish@apple.com>; Ray Ni
> <ray.ni@intel.com>
> 主题: [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg
> 
> Remove RUNTIME_FUNCTION redefinition error workaround from
> the following commit to the MdePkg that only impacts EmulatorPkg
> builds that uses windows include files:
> 
> https://github.com/tianocore/edk2/commit/ff52068d9261b9391d75b83a2a4
> e40e040f3b6eb
> 
> The correct location for this fix is in the EmulatorPkg
> in the WinInclude.h file that addresses all the name
> collisions between edk2 types and windows types.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Michael D Kinney michael.d.kinney@intel.com
> 
> Michael D Kinney (2):
>   EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
>   MdePkg/Include/IndustryStandard: Remove VS20xx workaround
> 
>  EmulatorPkg/Win/Host/WinInclude.h         | 10 ++++++----
>  MdePkg/Include/IndustryStandard/PeImage.h |  5 -----
>  2 files changed, 6 insertions(+), 9 deletions(-)
> 
> --
> 2.40.1.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107147): https://edk2.groups.io/g/devel/message/107147
Mute This Topic: https://groups.io/mt/100321453/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg
  2023-07-22  1:06 [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg Michael D Kinney
                   ` (2 preceding siblings ...)
  2023-07-24  1:09 ` [edk2-devel] 回复: [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg gaoliming via groups.io
@ 2023-07-24  1:11 ` Rebecca Cran
  3 siblings, 0 replies; 6+ messages in thread
From: Rebecca Cran @ 2023-07-24  1:11 UTC (permalink / raw)
  To: Michael D Kinney, devel
  Cc: Gerd Hoffmann, Liming Gao, Zhiguang Liu, Andrew Fish, Ray Ni

For the series:


Reviewed-by: Rebecca Cran <rebecca@bsdio.com>


On 7/21/23 19:06, Michael D Kinney wrote:
> Remove RUNTIME_FUNCTION redefinition error workaround from
> the following commit to the MdePkg that only impacts EmulatorPkg
> builds that uses windows include files:
>
> https://github.com/tianocore/edk2/commit/ff52068d9261b9391d75b83a2a4e40e040f3b6eb
>
> The correct location for this fix is in the EmulatorPkg
> in the WinInclude.h file that addresses all the name
> collisions between edk2 types and windows types.
>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Michael D Kinney michael.d.kinney@intel.com
>
> Michael D Kinney (2):
>    EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
>    MdePkg/Include/IndustryStandard: Remove VS20xx workaround
>
>   EmulatorPkg/Win/Host/WinInclude.h         | 10 ++++++----
>   MdePkg/Include/IndustryStandard/PeImage.h |  5 -----
>   2 files changed, 6 insertions(+), 9 deletions(-)
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107148): https://edk2.groups.io/g/devel/message/107148
Mute This Topic: https://groups.io/mt/100288520/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error
  2023-07-22  1:06 ` [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error Michael D Kinney
@ 2023-07-24  1:56   ` Ni, Ray
  0 siblings, 0 replies; 6+ messages in thread
From: Ni, Ray @ 2023-07-24  1:56 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io
  Cc: Gerd Hoffmann, Rebecca Cran, Andrew Fish

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Saturday, July 22, 2023 9:06 AM
> To: devel@edk2.groups.io
> Cc: Gerd Hoffmann <kraxel@redhat.com>; Rebecca Cran <rebecca@bsdio.com>;
> Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION
> redefinition error
> 
> Update WinInclude.h to prevent error due to redefinition of
> RUNTIME_FUNCTION using same technique that has been used
> in the past for structure types such as LIST_ENTRY.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  EmulatorPkg/Win/Host/WinInclude.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/EmulatorPkg/Win/Host/WinInclude.h
> b/EmulatorPkg/Win/Host/WinInclude.h
> index c2b6cfa3d658..877d2b0ed016 100644
> --- a/EmulatorPkg/Win/Host/WinInclude.h
> +++ b/EmulatorPkg/Win/Host/WinInclude.h
> @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  //
>  // Win32 include files do not compile clean with /W4, so we use the warning
> -// pragma to suppress the warnings for Win32 only. This way our code can stil
> +// pragma to suppress the warnings for Win32 only. This way our code can still
>  // compile at /W4 (highest warning level) with /WX (warnings cause build
>  // errors).
>  //
> @@ -19,9 +19,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #pragma warning(disable : 4028)
>  #pragma warning(disable : 4133)
> 
> -#define GUID         _WINNT_DUP_GUID_____
> -#define _LIST_ENTRY  _WINNT_DUP_LIST_ENTRY_FORWARD
> -#define LIST_ENTRY   _WINNT_DUP_LIST_ENTRY
> +#define GUID              _WINNT_DUP_GUID_____
> +#define _LIST_ENTRY       _WINNT_DUP_LIST_ENTRY_FORWARD
> +#define LIST_ENTRY        _WINNT_DUP_LIST_ENTRY
> +#define RUNTIME_FUNCTION  _WINNT_DUP_RUNTIME_FUNCTION
>  #if defined (MDE_CPU_IA32) && (_MSC_VER < 1800)
>  #define InterlockedIncrement          _WINNT_DUP_InterlockedIncrement
>  #define InterlockedDecrement          _WINNT_DUP_InterlockedDecrement
> @@ -45,6 +46,7 @@ typedef UINT32 size_t;
>  #undef GUID
>  #undef _LIST_ENTRY
>  #undef LIST_ENTRY
> +#undef RUNTIME_FUNCTION
>  #undef InterlockedIncrement
>  #undef InterlockedDecrement
>  #undef InterlockedCompareExchange64
> --
> 2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107151): https://edk2.groups.io/g/devel/message/107151
Mute This Topic: https://groups.io/mt/100288521/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-24  1:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-22  1:06 [edk2-devel] [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg Michael D Kinney
2023-07-22  1:06 ` [edk2-devel] [Patch 1/2] EmulatorPkg/Win/Host: Fix RUNTIME_FUNCTION redefinition error Michael D Kinney
2023-07-24  1:56   ` Ni, Ray
2023-07-22  1:06 ` [edk2-devel] [Patch 2/2] MdePkg/Include/IndustryStandard: Remove VS20xx workaround Michael D Kinney
2023-07-24  1:09 ` [edk2-devel] 回复: [Patch 0/2] Move RUNTIME_FUNCTION redefintion fix to EmulatorPkg gaoliming via groups.io
2023-07-24  1:11 ` [edk2-devel] " Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox