discuss-gnustep
[Top][All Lists]
Advanced

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

Re: objc compiler not detected


From: Riccardo Mottola
Subject: Re: objc compiler not detected
Date: Fri, 04 Oct 2013 17:53:46 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21

Hi,

Wolfgang Lux wrote:
Hi Riccardo,

I tried building the test standalone I can reproduce the error (just building 
config.objc.m). The problem reproduces:

grid$ ./conftest
objc runtime: cannot find class Test
[1]   Abort trap (core dumped) ./conftest

the stacktrace doesn't reveal anything useful to my eyes:
#0  0xbbb37c17 in _lwp_kill () from /usr/lib/libc.so.12
#1  0xbbb37bb6 in raise () from /usr/lib/libc.so.12
#2  0xbbb371f7 in abort () from /usr/lib/libc.so.12
#3  0xbbbbdf93 in objc_verror () from /usr/lib/libobjc.so.3
#4  0xbbbbdfd2 in objc_error () from /usr/lib/libobjc.so.3
#5  0xbbbbd3a3 in objc_get_class () from /usr/lib/libobjc.so.3
#6  0x080489a5 in main () at config.objc.m:21

Did I manage to get a broken runtime? I hope not. I wonder what could be going 
bad here.

I reduced the compile line to:
gcc -o conftest -g -O2  -fgnu-runtime -x objective-c  config.objc.m -lrt  
-lpthread -rdynamic -shared-libgcc -pthread -fexceptions -fgnu-runtime  -lobjc 
-lm

since we do not need all the headers and libraries anyway (and the compiler is 
much faster! wow!). However, same error :(
Of course it works for me on NetBSD 6.2.1 (the latest release, which was 
released just a few days ago). The compiler is gcc 4.5.3. You might check that 
the class definition is generated in the executable. The output for
   nm conftest | grep Test
on my NetBSD system is
08049420 d _OBJC_CLASS_METHODS_Test
080494a0 d _OBJC_CLASS_Test
08049340 d _OBJC_CLASS_VARIABLES_Test
08049460 d _OBJC_METACLASS_Test
08048a38 R __objc_class_name_Test
08049878 d __objc_class_ref_Test
0804892e t _c_Test__initialize
08048933 t _c_Test__testResult
If those definitions are present (possibly with different addresses) you might 
check that __objc_exec_class is called in the executable, which should register 
the Test class in the runtime system. Unfortunately, there is no easy way to 
inspect the argument of this function without building a debugging version of 
the Objective-C runtime library.
Those definitions are present:
grid$ nm conftest | grep Test
08049420 d _OBJC_CLASS_METHODS_Test
080494a0 d _OBJC_CLASS_Test
08049340 d _OBJC_CLASS_VARIABLES_Test
08049460 d _OBJC_METACLASS_Test
08048988 R __objc_class_name_Test
08049878 d __objc_class_ref_Test
08048892 t _c_Test__initialize
08048897 t _c_Test__testResult

Do you think this simple test in gdb is enough?

(gdb) b __objc_exec_class
Breakpoint 1 at 0x80485d0
(gdb) r
Starting program: /home/multix/gnustep-cvs/devmodules/core/base/config/conftest
objc runtime: cannot find class Test

Program received signal SIGABRT, Aborted.
[Switching to LWP 1]
0xbbb37c17 in _lwp_kill () from /usr/lib/libc.so.12


It means that I never get into that.

Riccardo






reply via email to

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