public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
@ 2024-09-12  6:52 Chun-Yi Lee
  2024-09-12  6:56 ` joeyli via groups.io
  2024-09-13  0:57 ` 回复: " gaoliming via groups.io
  0 siblings, 2 replies; 4+ messages in thread
From: Chun-Yi Lee @ 2024-09-12  6:52 UTC (permalink / raw)
  To: devel; +Cc: Zhiguang Liu, Michael D Kinney, Chun-Yi Lee

Using __FILE_NAME__ is useful for reducing the size of debug image and
it's also good for reproducable builds. The gcc-12 also supported this
macro.

Ref: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a37dad57a371a0d4c

This patch removed the checking of __clang__ when using __FILE_NAME__.

Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Chun-Yi Lee <jlee@suse.com>
---
 MdePkg/Include/Library/DebugLib.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index 0db3b78e..fc5c8346 100644
--- a/MdePkg/Include/Library/DebugLib.h
+++ b/MdePkg/Include/Library/DebugLib.h
@@ -342,13 +342,13 @@ UnitTestDebugAssert (
   #if defined (_ASSERT)
     #undef _ASSERT
   #endif
-  #if defined (__clang__) && defined (__FILE_NAME__)
+  #if defined (__FILE_NAME__)
 #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
   #else
 #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
   #endif
 #else
-  #if defined (__clang__) && defined (__FILE_NAME__)
+  #if defined (__FILE_NAME__)
 #define _ASSERT(Expression)  DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
   #else
 #define _ASSERT(Expression)  DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
-- 
2.35.3



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



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

* Re: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
  2024-09-12  6:52 [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12 Chun-Yi Lee
@ 2024-09-12  6:56 ` joeyli via groups.io
  2024-09-13  0:57 ` 回复: " gaoliming via groups.io
  1 sibling, 0 replies; 4+ messages in thread
From: joeyli via groups.io @ 2024-09-12  6:56 UTC (permalink / raw)
  To: Chun-Yi Lee; +Cc: devel, Zhiguang Liu, Michael D Kinney

Hi all,

On Thu, Sep 12, 2024 at 02:52:09PM +0800, Chun-Yi Lee wrote:
> Using __FILE_NAME__ is useful for reducing the size of debug image and
> it's also good for reproducable builds. The gcc-12 also supported this
> macro.
> 
> Ref: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a37dad57a371a0d4c
> 
> This patch removed the checking of __clang__ when using __FILE_NAME__.
> 

I also filed a merge request for this patch:

MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12 #6193
https://github.com/tianocore/edk2/pull/6193

Thanks a lot!
Joey Lee

> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Chun-Yi Lee <jlee@suse.com>
> ---
>  MdePkg/Include/Library/DebugLib.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
> index 0db3b78e..fc5c8346 100644
> --- a/MdePkg/Include/Library/DebugLib.h
> +++ b/MdePkg/Include/Library/DebugLib.h
> @@ -342,13 +342,13 @@ UnitTestDebugAssert (
>    #if defined (_ASSERT)
>      #undef _ASSERT
>    #endif
> -  #if defined (__clang__) && defined (__FILE_NAME__)
> +  #if defined (__FILE_NAME__)
>  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #else
>  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #endif
>  #else
> -  #if defined (__clang__) && defined (__FILE_NAME__)
> +  #if defined (__FILE_NAME__)
>  #define _ASSERT(Expression)  DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #else
>  #define _ASSERT(Expression)  DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> -- 
> 2.35.3


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



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

* 回复: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
  2024-09-12  6:52 [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12 Chun-Yi Lee
  2024-09-12  6:56 ` joeyli via groups.io
@ 2024-09-13  0:57 ` gaoliming via groups.io
  2024-09-13  1:28   ` joeyli via groups.io
  1 sibling, 1 reply; 4+ messages in thread
From: gaoliming via groups.io @ 2024-09-13  0:57 UTC (permalink / raw)
  To: devel, joeyli.kernel
  Cc: 'Zhiguang Liu', 'Michael D Kinney',
	'Chun-Yi Lee'

Please submit it in Github Edk2 as pull request. I agree this is a good
change. 

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Chun-Yi Lee
> 发送时间: 2024年9月12日 14:52
> 收件人: devel@edk2.groups.io
> 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> <michael.d.kinney@intel.com>; Chun-Yi Lee <jlee@suse.com>
> 主题: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG
> ASSERT for GCC12
> 
> Using __FILE_NAME__ is useful for reducing the size of debug image and
> it's also good for reproducable builds. The gcc-12 also supported this
> macro.
> 
> Ref:
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a3
> 7dad57a371a0d4c
> 
> This patch removed the checking of __clang__ when using __FILE_NAME__.
> 
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Chun-Yi Lee <jlee@suse.com>
> ---
>  MdePkg/Include/Library/DebugLib.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Library/DebugLib.h
> b/MdePkg/Include/Library/DebugLib.h
> index 0db3b78e..fc5c8346 100644
> --- a/MdePkg/Include/Library/DebugLib.h
> +++ b/MdePkg/Include/Library/DebugLib.h
> @@ -342,13 +342,13 @@ UnitTestDebugAssert (
>    #if defined (_ASSERT)
>      #undef _ASSERT
>    #endif
> -  #if defined (__clang__) && defined (__FILE_NAME__)
> +  #if defined (__FILE_NAME__)
>  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__,
> DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #else
>  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__,
> DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #endif
>  #else
> -  #if defined (__clang__) && defined (__FILE_NAME__)
> +  #if defined (__FILE_NAME__)
>  #define _ASSERT(Expression)  DebugAssert (__FILE_NAME__,
> DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
>    #else
>  #define _ASSERT(Expression)  DebugAssert (__FILE__,
> DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> --
> 2.35.3
> 
> 
> 
> 
> 





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



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

* Re: 回复: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
  2024-09-13  0:57 ` 回复: " gaoliming via groups.io
@ 2024-09-13  1:28   ` joeyli via groups.io
  0 siblings, 0 replies; 4+ messages in thread
From: joeyli via groups.io @ 2024-09-13  1:28 UTC (permalink / raw)
  To: devel, gaoliming
  Cc: joeyli.kernel, 'Zhiguang Liu', 'Michael D Kinney'

Hi gaoliming,

Thanks for your review! I have sent pull request to edk2 github: 

https://github.com/tianocore/edk2/pull/6193

Joey Lee

On Fri, Sep 13, 2024 at 08:57:26AM +0800, gaoliming via groups.io wrote:
> Please submit it in Github Edk2 as pull request. I agree this is a good
> change. 
> 
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Chun-Yi Lee
> > 发送时间: 2024年9月12日 14:52
> > 收件人: devel@edk2.groups.io
> > 抄送: Zhiguang Liu <zhiguang.liu@intel.com>; Michael D Kinney
> > <michael.d.kinney@intel.com>; Chun-Yi Lee <jlee@suse.com>
> > 主题: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG
> > ASSERT for GCC12
> > 
> > Using __FILE_NAME__ is useful for reducing the size of debug image and
> > it's also good for reproducable builds. The gcc-12 also supported this
> > macro.
> > 
> > Ref:
> > https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a3
> > 7dad57a371a0d4c
> > 
> > This patch removed the checking of __clang__ when using __FILE_NAME__.
> > 
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Signed-off-by: Chun-Yi Lee <jlee@suse.com>
> > ---
> >  MdePkg/Include/Library/DebugLib.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/MdePkg/Include/Library/DebugLib.h
> > b/MdePkg/Include/Library/DebugLib.h
> > index 0db3b78e..fc5c8346 100644
> > --- a/MdePkg/Include/Library/DebugLib.h
> > +++ b/MdePkg/Include/Library/DebugLib.h
> > @@ -342,13 +342,13 @@ UnitTestDebugAssert (
> >    #if defined (_ASSERT)
> >      #undef _ASSERT
> >    #endif
> > -  #if defined (__clang__) && defined (__FILE_NAME__)
> > +  #if defined (__FILE_NAME__)
> >  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__,
> > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> >    #else
> >  #define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__,
> > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> >    #endif
> >  #else
> > -  #if defined (__clang__) && defined (__FILE_NAME__)
> > +  #if defined (__FILE_NAME__)
> >  #define _ASSERT(Expression)  DebugAssert (__FILE_NAME__,
> > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> >    #else
> >  #define _ASSERT(Expression)  DebugAssert (__FILE__,
> > DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
> > --
> > 2.35.3
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 
> 
> 
> 


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



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

end of thread, other threads:[~2024-09-13  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12  6:52 [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12 Chun-Yi Lee
2024-09-12  6:56 ` joeyli via groups.io
2024-09-13  0:57 ` 回复: " gaoliming via groups.io
2024-09-13  1:28   ` joeyli via groups.io

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