From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6E6F621A16EED for ; Tue, 23 May 2017 17:27:15 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2017 17:27:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,383,1491289200"; d="scan'208";a="1173470124" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga002.fm.intel.com with ESMTP; 23 May 2017 17:27:14 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 May 2017 17:27:14 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.59]) by ORSMSX157.amr.corp.intel.com ([169.254.9.129]) with mapi id 14.03.0319.002; Tue, 23 May 2017 17:27:14 -0700 From: "Kinney, Michael D" To: "afish@apple.com" , "Kinney, Michael D" CC: "edk2-devel@lists.01.org" , "Fan, Jeff" , "Wu, Hao A" , Laszlo Ersek Thread-Topic: [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol Thread-Index: AQHS1Bvps+cEwgPBI0yVHuet7kPBjKICn1nw Date: Wed, 24 May 2017 00:27:13 +0000 Message-ID: References: <1495581673-10788-1-git-send-email-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWFlNTVlZWYtM2Y1OC00N2VlLWJjYTgtMmE1ZGZmZjdhNDgyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImNOVUszSUtXblk5RTBIMVplQ1dvQjcybjRqbXBcL3pUNDRMeHdSaUg5aXBzPSJ9 dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2017 00:27:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Andrew, I agree in this specific case, making the global variable static should also resolve this issue. In general, we do not make module global variables static, so the=20 module global can be shared across multiple source files in the=20 module implementation. Not sure why this issue has not been seen with other tool chains. Mike > -----Original Message----- > From: afish@apple.com [mailto:afish@apple.com] > Sent: Tuesday, May 23, 2017 4:26 PM > To: Kinney, Michael D > Cc: edk2-devel@lists.01.org; Fan, Jeff ; Wu, Hao A > ; Laszlo Ersek > Subject: Re: [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplica= te symbol >=20 > Mike, >=20 > Do the other compilers promote (or is that demote) to static? Would not m= aking these > lib globals, and private functions static solve this class of issue? >=20 > Thanks, >=20 > Andrew Fish >=20 > > On May 23, 2017, at 4:21 PM, Michael Kinney wrote: > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D573 > > > > The SecPeiDebugAgentLib uses the global variable > > mMemoryDiscoveredNotifyList for a PPI notification on > > the Memory Discovered PPI. This same variable name is > > used in the DxeIplPeim for the same PPI notification. > > > > The XCODE5 tool chain detects this duplicate symbol > > when the OVMF platform is built with the flag > > -D SOURCE_DEBUG_ENABLE. > > > > The fix is to rename this global variable in the > > SecPeiDebugAgentLib library. > > > > Cc: Andrew Fish > > Cc: Jeff Fan > > Cc: Hao Wu > > Cc: Laszlo Ersek > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Michael D Kinney > > --- > > .../Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c |= 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgen= tLib.c > b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgen= tLib.c > > index b717e33..9f5223a 100644 > > --- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDeb= ugAgentLib.c > > +++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDeb= ugAgentLib.c > > @@ -32,7 +32,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR > mVectorHandoffInf > > } > > }; > > > > -GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR > mMemoryDiscoveredNotifyList[1] =3D { > > +GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR > mDebugAgentMemoryDiscoveredNotifyList[1] =3D { > > { > > (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), > > &gEfiPeiMemoryDiscoveredPpiGuid, > > @@ -554,7 +554,7 @@ InitializeDebugAgent ( > > // Register for a callback once memory has been initialized. > > // If memery has been ready, the callback funtion will be invoked i= mmediately > > // > > - Status =3D PeiServicesNotifyPpi (&mMemoryDiscoveredNotifyList[0]); > > + Status =3D PeiServicesNotifyPpi (&mDebugAgentMemoryDiscoveredNotif= yList[0]); > > if (EFI_ERROR (Status)) { > > DEBUG ((EFI_D_ERROR, "DebugAgent: Failed to register memory disco= vered > callback function!\n")); > > CpuDeadLoop (); > > -- > > 2.6.3.windows.1 > >