Ah yes the ld -dead_strip flag. Thanks for the reminder.

Pike


________________________________
 Van: Cameron Esfahani <[email protected]>
Aan: "[email protected]" <[email protected]> 
Verzonden: woensdag 2 januari 3:30 2013
Onderwerp: Re: [edk2] How to conditionally exclude a library?
 

Pike, you should also remember that all the supported linkers will dead strip 
any unused code. So if you conditionally remove any serial port code from your 
C code, the library code will get dead stripped, NULL-implementation or not.


[email protected]


On Jan 1, 2013, at 17:57, Andrew Fish <[email protected]> wrote:


Pike,
>
>
>The [LibraryClasses] section implies that the driver consumes an API in the 
>library. So you need to link an instance of the library. So in your serial 
>example there is 
>https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdePkg/Library/BaseSerialPortLibNull/.
> 
>
>
>So what you would expect to see in the DSC file for your platform is a mapping 
>to a SerialPortLib that matches your platform. If the platform does not 
>support a serial port you point to the Null version of the library, otherwise 
>you point to a serial port lib for your platform. 
>
>
>In general the idea is you just edit your platform DSC file to port your 
>platform. 
>
>Andrew Fish
>
> 
>
>On Dec 31, 2012, at 9:29 PM, Piker Alpha <[email protected]> wrote:
>
>Is there a way to conditionally exclude libraries? Let's take this example:
>>
>>
>>[LibraryClasses]
>>  PeimEntryPoint
>>  PeiServicesLib
>>  PcdLib
>>  HobLib
>>  SerialPortLib
>>  ReportStatusCodeLib
>>  PrintLib
>>  DebugLib
>>  BaseMemoryLib
>>
>>
>>What if I want to exclude one of the libraries? Say the SerialPortLib or 
>>DebugLib.
>>
>>
>>Actually. I am rather surprised that there isn't a predefined/uniform way of 
>>doing this. Especially since there is one (-D BUILD_FAT) for the FAT driver 
>>(and no other drivers) but there are so many mother boards without a serial 
>>port these days, yet no simple way to exclude it?
>>
>>
>>The only thing that I can come up with now is to copy/rename the file and 
>>comment the target library out of it. Then use something like (example):
>>
>>
>>!if $(SERIAL_PORT_SUPPORT)
>>      EmulatorPkg/Library/../original.inf
>>
>>!else
>>      EmulatorPkg/Library/../oroginal-NoSerial.inf
>>
>>!endif
>>
>>
>>Which of course is rather cumbersome, and thus I hope that there is a better 
>>way of doing this. Hopefully something I have missed. Thanks.
>>
>>
>>Pike------------------------------------------------------------------------------
>>Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
>>and more. Get SQL Server skills now (including 2012) with LearnDevNow -
>>200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
>>SALE $99.99 this month only - learn more at:
>>http://p.sf.net/sfu/learnmore_122512_______________________________________________
>>edk2-devel mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/edk2-devel
>>
>
------------------------------------------------------------------------------
>Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
>and much more. Keep your Java skills current with LearnJavaNow -
>200+ hours of step-by-step video tutorials by Java experts.
>SALE $49.99 this month only -- learn more at:
>http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
>edk2-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/edk2-devel
>
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to