bug-gnustep
[Top][All Lists]
Advanced

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

[bug #38189] gnustep make fails to detect thread support with libobjc2/c


From: Sebastian Reitenbach
Subject: [bug #38189] gnustep make fails to detect thread support with libobjc2/clang on openbsd
Date: Tue, 29 Jan 2013 09:57:27 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110613 SUSE/3.6.18-0.2.1 Firefox/3.6.18

URL:
  <http://savannah.gnu.org/bugs/?38189>

                 Summary: gnustep make fails to detect thread support with
libobjc2/clang on openbsd
                 Project: GNUstep
            Submitted by: buzzdee
            Submitted on: Di 29 Jan 2013 09:57:26 GMT
                Category: Makefiles
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I'm on OpenBSD 5.2 -current. There it seems that gnustep-make (1.6.2 release
and SVN) doesn't detect that the libobjc2 supports threading.

Using libobjc2 from svn, and llvm/clang 3.2.

So far this is what I researched:


I found in the beginning, the configure script sets the:
OBJC_RUNTIME_LIB=gnu,
due to ac_cv_library_combo=gnu-gnu-gnu

then later it is setting:
CFLAGS="$CFLAGS -fgnu-runtime -DGNU_RUNTIME"

CFLAGS="$CFLAGS -x objective-c -I$srcdir $OBJC_CPPFLAGS $OBJC_LDFLAGS"
if test "$OBJC_RUNTIME_LIB" = "gnu"; then
  CFLAGS="$CFLAGS -fgnu-runtime -DGNU_RUNTIME"
  if test "$OBJC_FINAL_LIB_FLAG" = ""; then
    OBJC_FINAL_LIB_FLAG=-lobjc
  fi
  OBJCRT="$OBJC_FINAL_LIB_FLAG"
fi


then, when it comes to test for thread support in the objc runtime, it uses
the config_thread.m test program and fails:

/* Test whether Objective-C runtime was compiled with thread support */

#ifdef GNU_RUNTIME
/* Dummy NXConstantString impl for so libobjc that doesn't include it */
#include <objc/NXConstStr.h>
@implementation NXConstantString
@end
#endif

#ifdef GNU_RUNTIME
#include <objc/thr.h>
#else
#include <pthread.h>
void *dummy_thread_function(void *dummy)
{
  pthread_exit(NULL);
}
#endif

#include <objc/Object.h>

int
main()
{
#ifdef GNU_RUNTIME
  id o = [Object new];

  return (objc_thread_detach (@selector(hash), o, nil) == NULL) ? -1 : 0;
#else

  /* On Apple, there is no ObjC-specific thread library.  We need to
   * use pthread directly.
   */
  pthread_t thread_id;
  int error = pthread_create (&thread_id, NULL, dummy_thread_function, NULL);

  if (error != 0)
    {
      return -1;
    }

  return 0;

#endif
}

clang -o conftest -O2 -pipe -g -x objective-c -I.   -fgnu-runtime
-DGNU_RUNTIME -I/usr/local/include/gnustep -L/usr/local/lib ./config_thread.m
-lobjc2  -pthread

$ clang -o conftest -O2 -pipe -g -x objective-c -I.   -fgnu-runtime
-DGNU_RUNTIME -I/usr/local/include/gnustep -L/usr/local/lib ./config_thread.m
-lobjc2  -pthread
./config_thread.m:6:17: warning: incomplete implementation
[-Wincomplete-implementation]
@implementation NXConstantString
                ^
/usr/include/objc/NXConstStr.h:43:1: note: method definition for 'cString' not
found                                                                         
                                                                              
                          
-(const char *) cString;
^
/usr/include/objc/NXConstStr.h:44:1: note: method definition for 'length' not
found                                                                         
                                                                              
                           
-(unsigned int) length;
^
In file included from ./config_thread.m:20:                                   
                                                                              
                                                                              
                          
In file included from /usr/local/include/gnustep/objc/Object.h:1:
In file included from /usr/local/include/gnustep/objc/runtime.h:211:
/usr/local/include/gnustep/objc/message.h:40:6: warning: incompatible
redeclaration of library function 'objc_msgSend_stret'
void objc_msgSend_stret(id self, SEL _cmd, ...);
     ^
/usr/local/include/gnustep/objc/message.h:40:6: note: 'objc_msgSend_stret' is
a builtin with type 'id (id, SEL, ...)'                                       
                                                                              
                           
In file included from ./config_thread.m:20:
In file included from /usr/local/include/gnustep/objc/Object.h:1:
/usr/local/include/gnustep/objc/runtime.h:254:1: error: unknown type name
'Method_t'
Method * class_copyMethodList(Class cls, unsigned int *outCount);
^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:280:1: error: unknown type name
'Method_t'                                                                    
                                                                              
                               
Method class_getClassMethod(Class aClass, SEL aSelector);
^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:294:1: error: unknown type name
'Method_t'                                                                    
                                                                              
                               
Method class_getInstanceMethod(Class aClass, SEL aSelector);
^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:448:31: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
char* method_copyArgumentType(Method method, unsigned int index);
                              ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:454:29: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
char* method_copyReturnType(Method method);
                            ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:461:37: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
void method_exchangeImplementations(Method m1, Method m2);
                                    ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:461:48: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
void method_exchangeImplementations(Method m1, Method m2);
                                               ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:470:29: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
void method_getArgumentType(Method method, unsigned int index, char *dst,
size_t dst_len);
                            ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:475:30: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
IMP method_getImplementation(Method method);
                             ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:484:20: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
SEL method_getName(Method method);
                   ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:490:38: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
unsigned method_getNumberOfArguments(Method method);
                                     ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:499:27: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
void method_getReturnType(Method method, char *dst, size_t dst_len);
                          ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:506:37: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
const char * method_getTypeEncoding(Method method);
                                    ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:513:30: error: unknown type name
'Method_t'                                                                    
                                                                              
                              
IMP method_setImplementation(Method method, IMP imp);
                             ^
/usr/local/include/gnustep/objc/runtime.h:132:17: note: expanded from macro
'Method'                                                                      
                                                                              
                             
#       define Method Method_t
                      ^
/usr/local/include/gnustep/objc/runtime.h:772:34: warning: declaration of
'struct objc_super' will not be visible outside of this function
[-Wvisibility]                                                                
                                             
IMP objc_msg_lookup_super(struct objc_super*, SEL) OBJC_NONPORTABLE;
                                 ^
In file included from ./config_thread.m:20:                                   
                                                                              
                                                                              
                          
In file included from /usr/local/include/gnustep/objc/Object.h:1:
In file included from /usr/local/include/gnustep/objc/runtime.h:1036:
/usr/local/include/gnustep/objc/runtime-deprecated.h:75:16: warning: attribute
declaration must precede definition [-Wignored-attributes]
__attribute__((deprecated))
               ^
/usr/include/objc/objc.h:58:1: note: previous definition is here              
                                                                              
                                                                              
                          
sel_eq (SEL s1, SEL s2)
^
In file included from ./config_thread.m:20:                                   
                                                                              
                                                                              
                          
/usr/local/include/gnustep/objc/Object.h:3:1: error: duplicate interface
definition for class 'Object'
@interface Object
^
/usr/include/objc/Object.h:41:12: note: previous definition is here           
                                                                              
                                                                              
                          
@interface Object
           ^
4 warnings and 15 errors generated.                                           
                                                                              
                                                                              
                          
$ 



Here, when I run the same thing, but without the -DGNU_RUNTIME, the test
program seems to work:


$ clang -o conftest -O2 -pipe -g -x objective-c -I.   -fgnu-runtime
-I/usr/local/include/gnustep -L/usr/local/lib ./config_thread.m -lobjc2 
-pthread               
In file included from ./config_thread.m:20:
In file included from /usr/local/include/gnustep/objc/Object.h:1:
In file included from /usr/local/include/gnustep/objc/runtime.h:211:
/usr/local/include/gnustep/objc/message.h:40:6: warning: incompatible
redeclaration of library function 'objc_msgSend_stret'
void objc_msgSend_stret(id self, SEL _cmd, ...);
     ^
/usr/local/include/gnustep/objc/message.h:40:6: note: 'objc_msgSend_stret' is
a builtin with type 'id (id, SEL, ...)'                                       
                                                                              
                           
1 warning generated.

I'm unsure what the best approach would be here.

Sebastian




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38189>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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