Commit r28657

View: New views
9 Messages — Rating Filter:   Alert me  

Commit r28657

by Wolfgang Lux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi David,

In r28657 you've added the following code to GSFFIInvocation

#define __OBJC_LEGACY_GNU_MODE__
#import <objc/runtime.h>
#import <pthread.h>

Unfortunately, this breaks compilation for everyone who is using the
old runtime or gcc's libobjc directly (at least up to gcc 4.3) because
the file objc/runtime.h is not present. Could you please add an autoconf
test to include objc/runtime.h only conditionally or avoid including the
header altogether.

Wolfgang

P.S.: Sorry about the fuss I made in my last mail -- it was an  
incarnation
of the its too early in the morning without enough coffee syndrome.



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 22 Sep 2009, at 11:44, Wolfgang Lux wrote:

> Unfortunately, this breaks compilation for everyone who is using the
> old runtime or gcc's libobjc directly (at least up to gcc 4.3) because
> the file objc/runtime.h is not present. Could you please add an  
> autoconf
> test to include objc/runtime.h only conditionally or avoid including  
> the
> header altogether.

This seems odd to me.  Every version of GCC's libobjc I have seen  
(versions 1.6 to 3) has included an objc/runtime.h file.  Looking at  
the file in GCC's svn[1], it has a copyright date of 1993, so it's  
been around for a while.  What platform are you using?  Does it have  
the other objc headers installed?  Presumably it is finding objc/
objc.h and objc/objc-api.h, or other parts of GNUstep would not be  
compiling correctly...

David

[1] http://gcc.gnu.org/viewcvs/trunk/libobjc/objc/runtime.h?revision=145841&view=markup


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by Nicola Pero-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 22 Sep 2009, at 13:21, David Chisnall wrote:

> On 22 Sep 2009, at 11:44, Wolfgang Lux wrote:
>
>> Unfortunately, this breaks compilation for everyone who is using the
>> old runtime or gcc's libobjc directly (at least up to gcc 4.3)  
>> because
>> the file objc/runtime.h is not present. Could you please add an  
>> autoconf
>> test to include objc/runtime.h only conditionally or avoid  
>> including the
>> header altogether.
>
> This seems odd to me.  Every version of GCC's libobjc I have seen  
> (versions 1.6 to 3) has included an objc/runtime.h file.  Looking at  
> the file in GCC's svn[1], it has a copyright date of 1993, so it's  
> been around for a while.  What platform are you using?  Does it have  
> the other objc headers installed?  Presumably it is finding objc/
> objc.h and objc/objc-api.h, or other parts of GNUstep would not be  
> compiling correctly...

IIRC objc/runtime.h is a private header used internally while  
compiling libobjc.  It is not for users and so it is not installed.

Thanks


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 22 Sep 2009, at 13:43, Nicola Pero wrote:

> IIRC objc/runtime.h is a private header used internally while  
> compiling libobjc.  It is not for users and so it is not installed.

Very odd; looking at the Makefile, you seem to be correct, but it's  
installed on FreeBSD anyway.  Could someone who understands how the  
configure script works add a check for the existence of runtime.h?

David


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by Wolfgang Lux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Am 22.09.2009 um 14:21 schrieb David Chisnall:

> On 22 Sep 2009, at 11:44, Wolfgang Lux wrote:
>
>> Unfortunately, this breaks compilation for everyone who is using the
>> old runtime or gcc's libobjc directly (at least up to gcc 4.3)  
>> because
>> the file objc/runtime.h is not present. Could you please add an  
>> autoconf
>> test to include objc/runtime.h only conditionally or avoid  
>> including the
>> header altogether.
>
> This seems odd to me.  Every version of GCC's libobjc I have seen  
> (versions 1.6 to 3) has included an objc/runtime.h file.  Looking  
> at the file in GCC's svn[1], it has a copyright date of 1993, so  
> it's been around for a while.  What platform are you using?  Does  
> it have the other objc headers installed?  Presumably it is finding  
> objc/objc.h and objc/objc-api.h, or other parts of GNUstep would  
> not be compiling correctly...

I first noticed this issue after an svn up on my old PowerBook  
running OS X
where I compile GNUstep with Apple's gcc 4 and use the old Objective  
C runtime
from GNUstep svn. There is indeed a file objc/runtime.h, but it  
doesn't get
installed. I've then checked both gcc 4.1 and gcc 4.3 built with  
MacPorts on
OS X, also NetBSD 4.0 and 5.0, SuSE Linux 11.1, also my (a bit dated)  
GNUstep
MinGW installation. For all of them the respective objc directory  
looks as
follows:

NXConstStr.h    encoding.h      objc-decls.h    sarray.h
Object.h        hash.h          objc-list.h     thr.h
Protocol.h      objc-api.h      objc.h          typedstream.h

Only my FreeBSD 7.2 installation does have a runtime.h.

Wolfgang



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by Wolfgang Lux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Chisnall wrote:

> On 22 Sep 2009, at 13:43, Nicola Pero wrote:
>
>> IIRC objc/runtime.h is a private header used internally while  
>> compiling libobjc.  It is not for users and so it is not installed.
>
> Very odd; looking at the Makefile, you seem to be correct, but it's  
> installed on FreeBSD anyway.  Could someone who understands how the  
> configure script works add a check for the existence of runtime.h?

Given Nicola's comment may I suggest you change libobjc2 instead and  
move the relevant definitions to a publicly visible header, probably  
<objc/objc-api.h>.

I think you will then be able to copy configure.ac's already existing  
logic that tests for the presence of objc_msg_forward2 and check for  
the availability of objc_msg_forward3 and/or objc_proxy_lookup and  
don't have to include non-portable headers.

Wolfgang



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Parent Message unknown Re: Commit r28657

by Wolfgang Lux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Chisnall wrote:

> On 22 Sep 2009, at 17:17, Wolfgang Lux wrote:
>
>> David Chisnall wrote:
>>
>>> On 22 Sep 2009, at 13:43, Nicola Pero wrote:
>>>
>>>> IIRC objc/runtime.h is a private header used internally while  
>>>> compiling libobjc.  It is not for users and so it is not installed.
>>>
>>> Very odd; looking at the Makefile, you seem to be correct, but  
>>> it's installed on FreeBSD anyway.  Could someone who understands  
>>> how the configure script works add a check for the existence of  
>>> runtime.h?
>>
>> Given Nicola's comment may I suggest you change libobjc2 instead  
>> and move the relevant definitions to a publicly visible header,  
>> probably <objc/objc-api.h>.
>
> The runtime.h header in libobjc2 contains the same function  
> definitions as runtime.h on Apple's libobjc.  It is there for  
> source compatibility with the Apple runtime.
>
>> I think you will then be able to copy configure.ac's already  
>> existing logic that tests for the presence of objc_msg_forward2  
>> and check for the availability of objc_msg_forward3 and/or  
>> objc_proxy_lookup and don't have to include non-portable headers.
>
> runtime.h is the (only recommended) public header on OS X.

So then here is my take on the autoconf macros. I assume that you  
really want to test the presence of libobjc2 and take objc/runtime.h  
for granted (only) if using libobjc2. The following recipe therefore  
defines HAVE_LIBOBJC2 when it detects the new runtime.

Add the file config.forward3.m to the config directory (there are  
already config.forward.m and config.forward2.m):

#include <objc/runtime.h>

int main (void)
{
   struct objc_slot *(*__objc_msg_forward1)(id,SEL) = objc_msg_forward3;
   return 0;
}

Then add the following to configure.ac (e.g. below the test for  
objc_sync_enter):

AC_MSG_CHECKING(for libobjc2)
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward3.m"],
        have_libobjc2=yes, have_libobjc2=no)
if test $have_libobjc2 = yes; then
   AC_DEFINE(HAVE_LIBOBJC2,1,[Define if using libobjc2])
fi
AC_MSG_RESULT($have_libobjc2)

Finally update configure by running autoconf and autoheader and then  
test everything. Beware that I don't have libobjc2 installed at  
present, so I can't test it, and that its early in the morning :-)

Wolfgang





_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by David Chisnall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 23 Sep 2009, at 08:54, Wolfgang Lux wrote:

>  I assume that you really want to test the presence of libobjc2 and  
> take objc/runtime.h for granted (only) if using libobjc2

No, it should be safe to include it on any platform where it's  
present.  Longer term, when we are supporting the Apple runtime, this  
will be included everywhere again.  A macro is defined in libobjc2's  
runtime.h that lets us check for it.

David


_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Re: Commit r28657

by Wolfgang Lux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Chisnall wrote:

> On 23 Sep 2009, at 08:54, Wolfgang Lux wrote:
>
>>  I assume that you really want to test the presence of libobjc2  
>> and take objc/runtime.h for granted (only) if using libobjc2
>
> No, it should be safe to include it on any platform where it's  
> present.  Longer term, when we are supporting the Apple runtime,  
> this will be included everywhere again.  A macro is defined in  
> libobjc2's runtime.h that lets us check for it.

Okay. In that case the modifications are even simpler. It should  
suffice to add the line

  AC_CHECK_HEADERS(objc/runtime.h)

to configure.ac and run autoconf and autoheader. You can check  
whether runtime.h is available with the feature test macro  
HAVE_OBJC_RUNTIME_H.

Wolfgang



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@...
http://lists.gnu.org/mailman/listinfo/gnustep-dev