----------------------------------------
> Date: Tue, 25 Mar 2008 10:22:14 -0700
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: Re: Compiling C++ to C
> 
> Gabriel Sechan wrote:
>> ----------------------------------------
>>   
>>> Date: Mon, 24 Mar 2008 16:05:45 -0700
>>> From: [EMAIL PROTECTED]
>>> To: [email protected]
>>> Subject: Re: Compiling C++ to C
>>>
>>> Gabriel Sechan wrote:
>>>     
>>>> I have to port a C++ program to a new platform, using a specific version 
>>>> of a compiler (I guess technically I only have to be ABI compatible with 
>>>> said compiler).  Said compiler is for an embedded platform, and cannot be 
>>>> updated to a modern version because our partner has no plans to migrate.  
>>>> Needless to say, troubles arose.  This ancient version does not support 
>>>> templates.  We use templates.  Removing the templates would be painful-  
>>>> very painful.  So we're considering cross-compiling to C.  Has anyone done 
>>>> this?  Any pointers?  Anyone with any knowledge of the Comeau compiler?
>>>>
>>>> Gabe
>>>>       
>>> What about cfront?
>>>
>>>     
>> Looking at wikipedia, cfront seems to be abandoned (as of a failed version 
>> 4.0).  I can't find anyone actively offering it for sale or support.  This 
>> is a work project, not home, so I'm not looking to cheap out.  I might try 
>> downloading an old version, but I'd rather pay for something that's active 
>> than screw around with abandoned code for weeks.  
>>   
> You seriously can't use a modern gcc cross compiler to achieve ABI 
> compatibility?
> 
> Well, the Comeau compiler is actually a front end compiler that uses an 
> "ordinary" compiler as its backend. It's quite cheap and it has the 
> advantage of being more C++ standards compliant than anything else out 
> there, which is nice. It also has a mode where it will instantiate 
> template entities. So, perhaps that will suite your needs:
> 
> http://www.comeaucomputing.com/
> 
Nope.  Our software is going to be compiled into a partner's proprietary top 
secret RTOS, so it needs ABI compatibility with a multiple version old ARM 
compiler from a specific vendor (because of course neither of us trusts the 
other with code, so we're handing them off a binary).  Yes, this sucks, but 
getting our partner to upgrade his compiler to something modern (where we 
already compile) is not an option.

There might well be some option of gcc that will get us the right ABI-  I'm not 
a build expert.  The problem is we don't have the ability to check, other than 
calling up our partner, sending a build, and seeing if it barfs.  They'd have a 
limited patience for that.  Rewriting our code to not use templates might be a 
preferred option to it.

Although I'm definitely open to other ideas, this is the best one anyone over 
here can come up with.

Gabe
_________________________________________________________________
Watch “Cause Effect,” a show about real people making a real difference.  Learn 
more.
http://im.live.com/Messenger/IM/MTV/?source=text_watchcause--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to