From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 245067803CD for ; Thu, 12 Sep 2024 16:43:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6phEMnZIW8FYYac4WRF+KxWRmKiEYvz6NQx83P0if0k=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe; s=20240830; t=1726159423; v=1; x=1726418622; b=QwG4fNk++zgkXfvKFS7LlEfmnAbx6YssUFjI1Q2uwy5bvo+/mQfBs6oN9S/WwIcKkqOEixD5 7dfY8SA1a6clo5ePLrWoLJEJK1jHHfDhZ2imTHpBuRkYYz32y4rMnlzk0NmdKSpsz5mrTjH9WVu l8jpLY87OqiOBy+NTSZjn+FitLrSQ1BhiQR3o8cVz/RpVSUpA/aGqyFg81kvBA0GDg+bax02jk8 WWP06DQ5MY93+5GP6A29bg0pTsH6bRVFmtunnv9OZFVqb83h3yDMM1BWQjXEtLXw3fnfeYR6bNH FUF9qxt3KGpbtyexPGPQWNfsj6lOEfD297eg6nErrlV3Q== X-Received: by 127.0.0.2 with SMTP id M0OiYY7687511xlCyoWRGxPs; Thu, 12 Sep 2024 09:43:42 -0700 X-Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by mx.groups.io with SMTP id smtpd.web10.41602.1726123937088160083 for ; Wed, 11 Sep 2024 23:52:17 -0700 X-Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-39f526fd19bso2445995ab.1 for ; Wed, 11 Sep 2024 23:52:17 -0700 (PDT) X-Gm-Message-State: tj75v1T1JYnNimvmiidXLqfzx7686176AA= X-Google-Smtp-Source: AGHT+IGBM5vyF1hnAh9v0drsSM4tgYauDCQ83c9aMq2TaMdIF5V30K4IcV8No1Mz0zYPLbhtYRHyBw== X-Received: by 2002:a05:6e02:17c6:b0:39f:5d96:1fd5 with SMTP id e9e14a558f8ab-3a0848ae8b5mr16194815ab.1.1726123935949; Wed, 11 Sep 2024 23:52:15 -0700 (PDT) X-Received: from linux-l9pv.suse ([124.11.22.254]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db1fddd5c4sm1045696a12.67.2024.09.11.23.52.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Sep 2024 23:52:15 -0700 (PDT) From: Chun-Yi Lee X-Google-Original-From: Chun-Yi Lee To: devel@edk2.groups.io Cc: Zhiguang Liu , Michael D Kinney , Chun-Yi Lee Subject: [edk2-devel] [PATCH] MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12 Date: Thu, 12 Sep 2024 14:52:09 +0800 Message-Id: <20240912065209.12517-1-jlee@suse.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 12 Sep 2024 09:43:42 -0700 Resent-From: joeyli.kernel@gmail.com Reply-To: devel@edk2.groups.io,joeyli.kernel@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=QwG4fNk+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Cc: Michael D Kinney Signed-off-by: Chun-Yi Lee --- 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] -=-=-=-=-=-=-=-=-=-=-=-