On 03/30/15 20:30, B Cran wrote:
> I've discovered a difference in behavior between GCC48 and VS2012x86
> toolchains: Calling gBS->OpenProtocol(...
> &gEfiHiiPackageListProtocolGuid ...) works when built with VS2012x86 but
> returns Unsupported with GCC48.
> 
> A project that replicates the problem (built against the latest
> UDK2014.SP1 branch) can be downloaded
> from http://bluestop.org/PackageListGccBugDemo.zip .  It's a modified
> copy of MdeModulePkg/Universal/HiiResourcesSampleDxe .
> 
> Build it on Windows (I use Windows 8.1 Update) with:
> 
> build -p PackageListGccBugDemoPkg/PackageListGccBugDemoPkg.dsc -a X64 -t
> VS2012x86
> 
> And on Linux (I use OpenSUSE 13.2) with:
> 
> build -p PackageListGccBugDemoPkg/PackageListGccBugDemoPkg.dsc -a X64 -t
> GCC48
> 
> I've seen the problem under Qemu with OVMF built from the latest
> UDK2014.SP1 sources, and on a Minnowboard MAX board with 0.78 firmware.

I didn't try to reproduce this; but from some superficial skimming, the
protocol should be installed on the image handle in
CoreLoadImageCommon() [MdeModulePkg/Core/Dxe/Image/Image.c], dependent
on "Image->ImageContext.HiiResourceData".

That in turn should be set by PeCoffLoaderLoadImage()
[MdePkg/Library/BasePeCoffLib/BasePeCoff.c], near the end of the
function. It seems to depend on a large number of conditions. Maybe
gcc-built images don't satisfy all of those.

You could add DEBUG messages to those branches in
PeCoffLoaderLoadImage(), and see which is the first condition that fails
when loading an image built with gcc (while it succeeds for VS2012x86
builds).

You could also try cross-testing: build the test project with one
toolchain, and try to load the binary into a firmware that was built
with the other toolchain.

Thanks
Laszlo

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to