I think there is a fundamental problem in that the entry point to an ECP module is the entry point in its C code. For edk2 the entry point is a library that calls into AutoGenerated code to initialize libraries, and call the entry point in the modules C code. I don't think the build system for the ECP case does not generate the functions needed in the AutoGen.c code to use the edk2 entry point library.
If you look at the GccShell project you will note that we were able to use an edk2 library that does not have a constructor, or depend on any other edk2 library with the ECP. I'm not sure what the build system will do if the edk2 library depends on other edk2 libraries? You can always give it a try.
So it looks like you can treat edk2 libraries like ECP libraries, but constructors are not public. But then again you are pointing to a specific instance of the the library in the DSC file and if are willing to hard code that choice you could call the library constructor from the modules entry point C code and make it work more like EDK code. Note you also have the problem of if the library you use depends on more libraries, and those libraries have constructors. So it can get a little (a lot) sketchy. It may be possible to construct an EDK library that abstracts some of the yuckiness (for a give tree of library instances call the constructors in the right order, or make wrapper functions to glue things in like ASSERT()/DEBUG() so you don't have an ECP version and an edk2 version of the same thing in your binary.
On Jun 29, 2012, at 11:13 AM, Tim Lewis wrote:
> Is there standard way to have an EDK2 library also used by an ECP driver? Tim
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> edk2-devel mailing list