bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bugs #11188] configure check for __objc_msg_forward (checking "for forw


From: anonymous
Subject: [bugs #11188] configure check for __objc_msg_forward (checking "for forwarding callback in runtime") should be rewritten
Date: Fri, 10 Dec 2004 07:17:29 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.5) Gecko/20041122 Firefox/1.0

This mail is an automated notification from the bugs tracker
 of the project: GNUstep.

/**************************************************************************/
[bugs #11188] Latest Modifications:

Changes by: Anonymous user
Date:  
                Fre 10.12.2004 at 06:59

------------------ Additional Follow-up Comments ----------------------------
nearly perfect, except for the fact that configure does not know how to handle 
ObjC files correctly (for instance by creating 'conftest.m' instead of 
'conftest.c'

So:
 
./configure CC='/opt/local/bin/gcc' 

for base still (core.20041209.tar.bz2) fails on (Open)Darwin(/x86) like this:

configure:13838: checking "for forwarding callback in runtime"
configure:13844: /opt/local/bin/gcc -c -g -O2  -fgnu-runtime 
-I/opt/local/GNUstep/System/Library/Headers conftest.c >&5
cc1: warning: command line option "-fgnu-runtime" is valid for ObjC/ObjC++ but 
not for C
In file included from conftest.c:1:
./config/config.forward.m: In function 'main':
./config/config.forward.m:5: error: '__objc_msg_forward1' undeclared (first use 
in this function)
./config/config.forward.m:5: error: (Each undeclared identifier is reported 
only once
./config/config.forward.m:5: error: for each function it appears in.)
./config/config.forward.m:5: error: 'SEL' undeclared (first use in this 
function)
./config/config.forward.m:5: error: called object 'IMP(<erroneous-expression>)' 
is not a function
./config/config.forward.m:5: error: '__objc_msg_forward' undeclared (first use 
in this function)
configure:13850: $? = 1
configure: failed program was:
| #include "./config/config.forward.m"
configure:13873: result: no
configure:13880: checking "FFI library usage"
configure:14004: result: none
configure:14025: error: Incomplete support for ffi functionality.

A workaround for this was to use:

./configure CC='/opt/local/bin/gcc -x objective-c'

which resulted in:

checking "for forwarding callback in runtime"... yes
checking "FFI library usage"... ffcall

what is correct in my case (OpenDarwin/x86 has no support for libffi because 
the ABI is constantly changing)

regards, Lars






/**************************************************************************/
[bugs #11188] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11188>
Project: GNUstep
Submitted by: 0
On: Mit 01.12.2004 at 21:35

Category:  Base/Foundation
Severity:  5 - Average
Item Group:  Bug
Resolution:  Fixed
Privacy:  Public
Assigned to:  fedor
Status:  Closed


Summary:  configure check for __objc_msg_forward (checking "for forwarding 
callback in runtime") should be rewritten

Original Submission:  checking "for forwarding callback in runtime" currently 
checks if "__objc_msg_forward" is present in the preprocessed file from gcc (by 
invoking gcc with -E):

starting at line 13843:

have_forward_hook=yes
echo "$as_me:$LINENO: checking "for forwarding callback in runtime"" >&5
echo $ECHO_N "checking "for forwarding callback in runtime"... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h.  */
#include <objc/objc-api.h>

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "__objc_msg_forward" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; have_forward_hook=no
fi
rm -f conftest*

in line 13856 there is a grep for  "__objc_msg_forward". If that is present it 
is assumed that forwarding callback in runtime is working. 

there are some problems with that way of doing this. 

At first, as andrew pinski pointed out it is in no way guarantied that 
forwarding callback works if grep find a occurrence of "__objc_msg_forward". 
there could also be a variable named that way in the code.

Second and more important is that -E and -fgnu-runtime don't work together in 
the upcoming version 4.0 of gcc (and this is hard to fix according to pinskia 
at gcc dot gnu dot org):

cc1: warning: command line option "-fgnu-runtime" is valid for ObjC/ObjC++ but 
not for C

See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18772

because of that pinskia also proposed a better (and more robust) check for that 
feature:

try to compile:

#include <objc/objc-api.h>
...
IMP (*__objc_msg_forward1)(SEL) = __objc_msg_forward;
...

for questions please mail to 
lars dot sonchocky-helldorf at hamburg dot de 
and/or
pinskia at gcc dot gnu dot org

regards, Lars

Follow-up Comments
------------------


-------------------------------------------------------
Date: Fre 10.12.2004 at 06:59       By: 0 <None>
nearly perfect, except for the fact that configure does not know how to handle 
ObjC files correctly (for instance by creating 'conftest.m' instead of 
'conftest.c'

So:
 
./configure CC='/opt/local/bin/gcc' 

for base still (core.20041209.tar.bz2) fails on (Open)Darwin(/x86) like this:

configure:13838: checking "for forwarding callback in runtime"
configure:13844: /opt/local/bin/gcc -c -g -O2  -fgnu-runtime 
-I/opt/local/GNUstep/System/Library/Headers conftest.c >&5
cc1: warning: command line option "-fgnu-runtime" is valid for ObjC/ObjC++ but 
not for C
In file included from conftest.c:1:
./config/config.forward.m: In function 'main':
./config/config.forward.m:5: error: '__objc_msg_forward1' undeclared (first use 
in this function)
./config/config.forward.m:5: error: (Each undeclared identifier is reported 
only once
./config/config.forward.m:5: error: for each function it appears in.)
./config/config.forward.m:5: error: 'SEL' undeclared (first use in this 
function)
./config/config.forward.m:5: error: called object 'IMP(<erroneous-expression>)' 
is not a function
./config/config.forward.m:5: error: '__objc_msg_forward' undeclared (first use 
in this function)
configure:13850: $? = 1
configure: failed program was:
| #include "./config/config.forward.m"
configure:13873: result: no
configure:13880: checking "FFI library usage"
configure:14004: result: none
configure:14025: error: Incomplete support for ffi functionality.

A workaround for this was to use:

./configure CC='/opt/local/bin/gcc -x objective-c'

which resulted in:

checking "for forwarding callback in runtime"... yes
checking "FFI library usage"... ffcall

what is correct in my case (OpenDarwin/x86 has no support for libffi because 
the ABI is constantly changing)

regards, Lars

-------------------------------------------------------
Date: Mit 08.12.2004 at 11:25       By: Adam Fedor <fedor>
Fixed.

2004-12-07  Adam Fedor  <fedor@gnu.org>
        * configure.ac: Test for objc forwarding by compiling a program.
        * config/config.forward.m: New file.
        (Fixes bug #11188).













For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11188>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]