From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 2F6C8221EA0A9 for ; Thu, 7 Dec 2017 08:48:26 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2017 08:52:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,373,1508828400"; d="scan'208";a="734959" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by fmsmga008.fm.intel.com with ESMTP; 07 Dec 2017 08:52:58 -0800 Received: from orsmsx154.amr.corp.intel.com (10.22.226.12) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Dec 2017 08:52:58 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.187]) by ORSMSX154.amr.corp.intel.com ([169.254.11.132]) with mapi id 14.03.0319.002; Thu, 7 Dec 2017 08:52:57 -0800 From: "Kinney, Michael D" To: Ard Biesheuvel , "Gao, Liming" , "Kinney, Michael D" CC: "Wu, Hao A" , "edk2-devel@lists.01.org" , Andrew Fish , Laszlo Ersek , Jeff Fan Thread-Topic: [edk2] [Patch] SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbol Thread-Index: AQHTby/x0Gtz2ztrKEinbVfYxKPJ2aM4F4gAgAABYcA= Date: Thu, 7 Dec 2017 16:52:57 +0000 Message-ID: References: <1512632891-5236-1-git-send-email-liming.gao@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDQ4MjY2ODQtZGQ0MC00ODBjLWJkZjctMjI3ODY2MTQ2N2M5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJcL1FkcjNDeTNOS3JwaW5xZE9wcnJnOU5GNTZ2bWViaFJxeVROY1BqMDBnWDlcL2JcL1wvXC9hYVk2cEFlSUtVeElzK2IifQ== dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.139] 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: Thu, 07 Dec 2017 16:48:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ard, If the variable was not prepended with GLOBAL_REMOVE_IF_UNREFERENCED, I wou= ld agree. GLOBAL_REMOVE_IF_UNREFERENCED for some compilers is not compatible with sta= tic. Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] > On Behalf Of Ard Biesheuvel > Sent: Thursday, December 7, 2017 12:47 AM > To: Gao, Liming > Cc: Wu, Hao A ; edk2- > devel@lists.01.org; Andrew Fish ; > Kinney, Michael D ; Laszlo > Ersek ; Jeff Fan > Subject: Re: [edk2] [Patch] > SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate > symbol >=20 > On 7 December 2017 at 07:48, Liming Gao > wrote: > > From: Michael Kinney > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D573 > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D796 > > > > The same issue is reported again by GCC. Resend this > patch again. > > This patch renames the duplicated function name to fix > it. > > > > 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. > > >=20 > No, the fix is to make it STATIC unless it *needs* to be > a global. > Is that the case here? >=20 >=20 > > 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 > > > Reviewed-by: Jeff Fan > > --- > > > .../Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentL > ib.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent > /SecPeiDebugAgentLib.c > b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent > /SecPeiDebugAgentLib.c > > index b717e33..9f5223a 100644 > > --- > a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent > /SecPeiDebugAgentLib.c > > +++ > b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent > /SecPeiDebugAgentLib.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 immediately > > // > > - Status =3D PeiServicesNotifyPpi > (&mMemoryDiscoveredNotifyList[0]); > > + Status =3D PeiServicesNotifyPpi > (&mDebugAgentMemoryDiscoveredNotifyList[0]); > > if (EFI_ERROR (Status)) { > > DEBUG ((EFI_D_ERROR, "DebugAgent: Failed to > register memory discovered callback function!\n")); > > CpuDeadLoop (); > > -- > > 2.6.3.windows.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > > GitPatchExtractor 1.1 > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel