On Oct 18, 2012, at 11:27 AM, Tim Lewis wrote:

> Amol –
>  
> Unlikely. It depends on your individual compiler and support library. Many 
> support libraries call underlying OS services directly, which obviously will 
> not work on UEFI. Also, adding the standard library to your build may confuse 
> the build process as to which should be used: the UEFI library or the one 
> that supports your OS. In my experience with C++ on UEFI, supported had to be 
> ported into EDK2 libraries natively.
>  

This is what I like about working with Firmware/Embedded Systems... It lends 
itself to having to to think about the system as a whole. As Tim points out 
when you first think about it it seems like a lot of libs could be generic, but 
then you realize the devil is in the details. Lost of library functions need to 
call malloc() and free() and these have OS specific implementations. Even a 
floating point library needs to be able to report an error, so it becomes OS 
specific. And the thing that makes everything really OS specific is how does 
the constructor for the library get called in the first place? Given all this 
folks don't tend to break libraries into the portable bits and the system 
specific bits when they ship, they seem to ship as a library ported to a given 
OS/Environment, and focus on optimizing for that environment. 

Thanks,

Andrew

> Tim
>  
> From: Amol Tasgaonkar [mailto:amol...@yahoo.com] 
> Sent: Thursday, October 18, 2012 10:08 AM
> To: Andrew Fish
> Cc: edk2-devel@lists.sourceforge.net
> Subject: Re: [edk2] Does UEFI support C++ Exception handling.
>  
> Is it posssible to still continue to static link with Standard libs to 
> resolve linking problems. Do you think the c++ exception handling will work? 
> The idea here is to use the limited subset of the functionlity provided by 
> the C++ library for the porting effort. Do you see any problems in this 
> approach ?
> -Amol.
> From: Andrew Fish <af...@apple.com>
> To: Amol Tasgaonkar <amol...@yahoo.com> 
> Cc: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net> 
> Sent: Wednesday, October 17, 2012 5:03 PM
> Subject: Re: [edk2] Does UEFI support C++ Exception handling.
>  
>  
> On Oct 17, 2012, at 4:53 PM, Amol Tasgaonkar wrote:
> 
> 
> So does this means that we cannot use STL's too ? I am surprized to know this.
>  
>  
> EFI is like the kernel or devices drivers and it is written in C. I don't 
> think there is any C++ support on the open source? I was just reference some 
> one was doing the experiment  on the side and talking about it on the mailing 
> list. 
>  
> Well all you have to do is link your application without any standard libs. 
> All the intrinsic calls generated by the complier and std libs called by your 
> code will fail to link. You can then implement these functions in an library 
> that does the right thing for EFI and you should be good. When you have this 
> exercise in front of you the idea of embedded C++ may seem like a better 
> idea..... I'm sure that is the only reason some one started with embedded C++ 
> as it would be easier to port. 
>  
> Thanks,
>  
> Andrew
>  
> From: Andrew Fish <af...@apple.com>
> To: Amol Tasgaonkar <amol...@yahoo.com>; edk2-devel@lists.sourceforge.net 
> Sent: Wednesday, October 17, 2012 4:11 PM
> Subject: Re: [edk2] Does UEFI support C++ Exception handling.
>  
> On Oct 17, 2012, at 4:04 PM, Amol Tasgaonkar wrote:
> 
> 
> Hi,
> I wanted to check if I could have C++ exception handling done in the EFI 
> application/
>  
> No. We generally don't support C++, I think some folks may have played with 
> embedded C++, but that does not support exceptions either. 
>  
> We don't link against standard libraries, and we generally try to avoid 
> writing code that generates compiler intrinsics where possible. 
> 
> 
>  
> Thank,
>  
> With Best Regards,
> -Amol.
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
>  
>  
> 
>  
>  
> 

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to