Re: How to link DXE_DRIVER from UEFI_APPLICATION?


Laszlo Ersek
 

On 02/06/21 05:49, joseph via [] wrote:
Hi Laszlo,

Thank you. But the problem is still not solved.

.../edk2/MyPkg/MyPkg.dsc(...): error 1001: Module type [UEFI_APPLICATION] is not supported by
library instance [.../edk2/SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf]
consumed by [.../edk2/MyPkg/MyApp/MyApp.inf]
After modifying several more steps through the method you suggested, the build was completed.
https://github.com/jc-lab/temp-edk2-tpm2-problem/commit/d9afc8f562d1bda190b27ac8db67df3b0a5bb24a
This is the bug (or, at least "one" bug) in your platform DSC file:

# TPM 2
Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
Tpm2DeviceLibTcg2|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf

There is no such library class as "Tpm2DeviceLibTcg2".


Please refer to the commit message in the following commit:

https://github.com/tianocore/edk2/commit/0c0a50d6b3ff

Specifically, please see the part that starts with "Laszlo Ersek explained on the list why Tpm2DeviceLib..."

Thanks,
Laszlo

But I get the error like below.

/usr/bin/ld: Tpm2DeviceLibTcg2.obj (symbol from plugin): in function `mTcg2Protocol':
(.text+0x0): multiple definition of `Tpm2SubmitCommand'; Tpm2DeviceLibDTpm.obj (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: Tpm2DeviceLibTcg2.obj (symbol from plugin): in function `mTcg2Protocol':
(.text+0x0): multiple definition of `Tpm2RequestUseTpm'; Tpm2DeviceLibDTpm.obj (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: Tpm2DeviceLibTcg2.obj (symbol from plugin): in function `mTcg2Protocol':
(.text+0x0): multiple definition of `Tpm2RegisterTpm2DeviceLib'; Tpm2DeviceLibDTpm.obj (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [GNUmakefile:375: ...MyApp.dll] Error 1
Can you help me a little more?

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