On Thu, Sep 12, 2013 at 12:18 AM, galla rao <gallagnv....@gmail.com> wrote:
> Dear All,
>
> I ported a OptionRom Code from EDK to UDK and found my .efi output file has
> increased from ~700k to ~1100k
>
> Building Code in UDK results in increase in Driver Size, is this how UDK is
> designed?
> Even the obj's have increased in size after compilation.
>
> Kindly Provide your inputs. Thank you All
>
> The libs i used from UDK
>
> BaseMemoryLib
> UefiDriverEntryPoint
> HiiLib
>
>
> Certain older EDK calls are replaced with newer UDK calls
> EfiLibAllocateZeroPoolè AllocateZeroPool; EfiZeroMemèZeroMem;
> EfiCopyMemèCopyMem; EfiSetMemèSetMem; EfiLibLookupUnicodeStringè
> LookupUnicodeString; SprintèUnicodeSprint
>
>  Introduced
> HiiAllocateOpCodeHandle, HiiCreateCheckBoxOpCode, HiiCreateTextOpCode,
> HiiCreateOneOfOptionOpCode, HiiUpdateForm, HiiCreateGuidOpCode
> Inplace of CreateOneOfOpCode, IfrLibUpdateForm, EFI_HII_UPDATE_DATA
>
> Compiler Flags
> MSFT:*_*_X64_CC_FLAGS = /nologo /c /WX- /GS- /X /W3 /Gs8192 /D /Zc:wchar_t-
> /D UNICODE  /Gy /FIAutoGen.h /EHs-c- /GR- /GF
>
> Linker flags
> RELEASE_VS2010x86_X64_DLINK_FLAGS  = /NOLOGO /NODEFAULTLIB /IGNORE:4001
> /IGNORE:4254  /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D
> /Machine:X64  /DLL /ENTRY:$(IMAGE_ENTRY_POINT)
> /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER  /BASE:0 /DRIVER /MERGE:.data=.text
> /MERGE:.rdata=.text

Did you actually change the CC/LINK flags? I don't think that is
commonly needed for achieving good sizes.

I think the RELEASE flags in the standard tools_def should work pretty
well ... except one thing ... :)

... DebugLib can add a lot of size. Something like this in your .dsc
might help for release builds.

[BuildOptions]
  GCC:RELEASE_*_*_CC_FLAGS             = -DMDEPKG_NDEBUG
  INTEL:RELEASE_*_*_CC_FLAGS           = /D MDEPKG_NDEBUG
  MSFT:RELEASE_*_*_CC_FLAGS            = /D MDEPKG_NDEBUG

Although, I thought MSVC usually did pretty good at removing dead code
at link time. So, you might check your
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel and
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask settings in your .dsc.

Also, you might also look at the LibraryClasses settings in your .dsc.

-Jordan

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to