Re: [PATCH v6 1/4] PcAtChipsetPkg: PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass


Dong, Eric
 

Hi Guomin, Laszlo & Garrett,

Because both UefiCpuLib and FspSecCoreT / FspSecCoreM both define InitializeFloatingPointUnits API. So this build issue been reported.

I have submit a patch to remove InitializeFloatingPointUnits in FspSecCoreT / FspSecCoreM, https://edk2.groups.io/g/devel/message/61757.

Please wait that patch been merged before committing this change.

Thanks,
Eric

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@...>
Sent: Sunday, June 28, 2020 5:11 PM
To: Laszlo Ersek <lersek@...>; devel@edk2.groups.io;
garrett.kirkendall@...
Cc: Ni, Ray <ray.ni@...>; Dong, Eric <eric.dong@...>
Subject: RE: [edk2-devel] [PATCH v6 1/4] PcAtChipsetPkg:
PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass

Hi Laszlo,

The step to reproduce as below:
1. add below change
diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 26cd3da43c3f..d43cb5be6472 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -62,7 +62,10 @@ [Components]
IntelFsp2Pkg/Library/BaseDebugDeviceLibNull/BaseDebugDeviceLibNull.inf

IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.in
f

- IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf
+ IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf {
+ <LibraryClasses>
+ NULL|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
+ }
IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
IntelFsp2Pkg/FspSecCore/FspSecCoreS.inf
IntelFsp2Pkg/FspSecCore/Fsp22SecCoreS.inf

2. build -p IntelFsp2Pkg\IntelFsp2Pkg.dsc -b DEBUG -a IA32 -t VS2019 and I
can see BaseUefiCpuLib.lib(InitializeFpu.obj) : error LNK2005:
_InitializeFloatingPointUnits already defined in
FspSecCoreT.lib(InitializeFpu.obj)

I can't reproduce it with the original edk2 or edk2-platforms, but our project
have the depend on ApicLib, so if the ApicLib depend on UefiCpuLib, it will
break our project build.

Below
Thanks.

-----Original Message-----
From: Laszlo Ersek <lersek@...>
Sent: Tuesday, June 23, 2020 7:16 PM
To: devel@edk2.groups.io; Jiang, Guomin <guomin.jiang@...>;
garrett.kirkendall@...
Cc: Ni, Ray <ray.ni@...>; Dong, Eric <eric.dong@...>
Subject: Re: [edk2-devel] [PATCH v6 1/4] PcAtChipsetPkg:
PcAtChipsetPkg.dsc add UefiCpuLib LibraryClass

On 06/23/20 02:52, Guomin Jiang wrote:
Hi Garrett,

Thanks for report quickly and it work and the 'Mac format issue
disappear'.

But another build error occur 'error LNK2005:
_InitializeFloatingPointUnits
already defined in FspSecCoreT.lib(InitializeFpu.obj)'
It seem that result by ApicLib who depend UefiCpuLib now.
Yes.

I want to know why you add this dependency,
It was discussed on the list in advance.

[edk2-devel] UefiCpuPkg: Discuss: Move
StandardSignatureIsAuthenticAMD
function to BaseUefiCpuLib

https://edk2.groups.io/g/devel/message/61079

In addition, we have investigated all the platforms in the open source
edk2 and edk2-platforms trees that could require an update due to the
new
dependency:

https://edk2.groups.io/g/devel/message/61525

And this series is in fact addressing them all.

have any other way to do it, for example, add the dependency to the
dsc
file.

Please describe how you can reproduce the link error using edk2 and
edk2- platforms content *only* (= using open source components only).

Thanks
Laszlo

Join devel@edk2.groups.io to automatically receive all group messages.