r187174 - Fix GNU ObjC ABI for a message returning a struct.

Jonathan Schleifer js at webkeks.org
Fri Aug 2 14:04:04 PDT 2013


Am 29.07.2013 um 22:24 schrieb John McCall:

> Yeah, the version is the minimum version of the runtime the user wants us to target.  So, for example, if you add new runtime features in an ObjFW release (like this...), but the user asks us to target ObjFW v0.7, then we need to not use those runtime features.  Eventually, when we settled on the desired behavior here, I was going to ask you to do this.

I honestly have to say that I don't really care about old versions as long as it's still at 0.x ;). But if you insist, I could do that. However, this would alsoo mean that -fobjc-runtime=objfw-$version for $version < 0.7 has to be interpreted as -fobjc-runtime=gcc.

> You could define a separate __OBJFW_COMPILER_VERSION__ that records the compiler’s target ObjFW version.  That would basically be the minimum of the last ABI revision you made in the compiler and the version from -fobjc-runtime.

Yes, that was the idea from the start. However, I think I misunderstood it somehow that it should be the ABI version, not the version of the ObjFW runtime.

> So, assuming the compiler supports targeting ObjFW 1.2.5, you’d get these macros:
> 
> Under -fobjc-runtime=objfw:
>   #define __OBJFW_VERSION__ 0x10205
>   #define __OBJFW_COMPILER_VERSION 0x10205
> 
> Under -fobjc-runtime=objfw-2.0:
>   #define __OBJFW_VERSION__ 0x20000
>   #define __OBJFW_COMPILER_VERSION 0x10205
> 
> Under -fobjc-runtime=objfw-1.1.3:
>   #define __OBJFW_VERSION__ 0x10103
>   #define __OBJFW_COMPILER_VERSION 0x10103
> 
> Make sense?

Actually, IMHO, there is not even need for two defines. The ObjFW version I know anyway, what I'm interested in is the ABI the compiler emits.

What I did now is:
 * Change the define to match the ObjFW version instead of an independent ABI version.
 * Add the subminor.
 * Check if the version is bigger than the highest version supported by Clang.
 * If so, reduce it to the highest supported version.

This way, I can always specify -fobjc-runtime=objfw-$version (where $version is the ObjFW version being compiled) and the define will be the highest version supported by Clang. So, basically, forwarding stret would be save if __OBJFW_RUNTIME_ABI__ >= 0x000800.

Can you please review and commit the attached patch?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-define-for-the-ObjFW-runtime-ABI-version.patch
Type: application/octet-stream
Size: 4692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130802/0aeb5076/attachment.obj>
-------------- next part --------------

--
Jonathan


More information about the cfe-commits mailing list