Combuster wrote:
Yes, EDK2 is a horrible example of how not to do things, using a proper PE-oriented toolchain is certainly the better alternative. In particular:
Quote:
What I prefer is creating my own library and compiling it as an ELF. You can use objcopy to get the proper UEFI format
EDK2 on linux does exactly that, and it results in defective binaries.
Since you seem to be using Visual Studio, you're probably interested in
it's /SUBSYSTEM linker option. To be honest, I wouldn't be surprised if that actually worked easier than a GNU toolchain for this matter.
I've just tried to compile with Visual Studio subsystem EFI application,
only to be told the missing of some #defines found in auto generated files when compile with EDK2...
including,
_PCD_GET_MODE_*
_PCD_VALUE_*
_PCD_TOKEN_*
such as
#define _PCD_TOKEN_PcdVerifyNodeInList 23U
#define _PCD_GET_MODE_BOOL_PcdVerifyNodeInList _gPcd_FixedAtBuild_PcdVerifyNodeInList
EDK2 generate them with python...and _gPcd_*s seems to...as its name...fixed at build...