discuss-gnustep
[Top][All Lists]
Advanced

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

Re: QNX - GNUstep and Objective C


From: bbceler
Subject: Re: QNX - GNUstep and Objective C
Date: Tue, 5 Jan 2010 02:31:10 -0800 (PST)

Hi,
I compiled  libobjc2 revision 29205 and test simple program.
bash-4.0# make clean
bash-4.0# make messages=yes CC=clang 2>&1 | tee CC.log
This is gnustep-make 2.2.0. Type 'make print-gnustep-make-help' for help.
Making all for tool LogTest...
cd .; \
        /usr/pkg/share/GNUstep/Makefiles/mkinstalldirs ./obj
make -f GNUmakefile --no-print-directory --no-keep-going \
        internal-tool-compile \
        GNUSTEP_TYPE=tool \
        GNUSTEP_INSTANCE=LogTest \
        GNUSTEP_OPERATION=compile \
        GNUSTEP_BUILD_DIR="." \
        _GNUSTEP_MAKE_PARALLEL=yes
clang source.m -c \
          -MMD -MP -I/usr/pkg/include -I/usr/pkg/share/GNUstep/include
-I/usr/include -g -D__QNXNTO__ -D__ X86__ -D__LITTLEENDIAN__
-D_FILE_OFFSET_BITS=64 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_RUNTIME=1
-DGNUSTEP_BASE_LIBRARY=1 -fPIC -shared 
-DGSWARN -DGSDIAGNOSE -Wno-import -O2 -I/usr/pkg/include
-I/usr/pkg/share/GNUstep/include 
-Wno-import -I/usr/include -fno-strict-aliasing -fgnu-runtime
-fconstant-string-class=NSConstantString
-I. -I/root/GNUstep/Library/Headers -I/usr/pkg/include \
          -o obj/source.m.o
clang  -Wl,--export-dynamic -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
-Wl,-R/usr/pkg/share/GNUstep/lib 
-L/usr/lib -Wl,-R/usr/lib -fgnu-runtime -o obj/LogTest \
          ./obj/source.m.o \
          -L/root/GNUstep/Library/Libraries -L/usr/pkg/lib -lobjc
-lgnustep-base -lobjc -lm
bash-4.0# cd obj
bash-4.0# ./LogTest
Error: Instance variables in GSAttrDictionary overlap superclass NSObject
Offset of first instance variable, statbuf, is 8
Last instance variable in superclass, isa, ends at offset 4
This probably means that you are subclassing a class from a library, which
has changed in a 
binary-incompatible way.
abort (core dumped)
bash-4.0#
bash-4.0# ldd LogTest
./LogTest:
        libobjc.so.4 => /usr/pkg/lib/libobjc.so.4 (0xb8200000)
        libgnustep-base.so.1.19 => /usr/pkg/lib/libgnustep-base.so.1.19
(0xb8220000)
        libm.so.2 => /lib/libm.so.2 (0xb85be000)
        libgmp.so.3 => /usr/pkg/lib/libgmp.so.3 (0xb85f1000)
        libgnutls.so.26 => /usr/pkg/lib/libgnutls.so.26 (0xb8653000)
        libgcrypt.so.11 => /usr/pkg/lib/libgcrypt.so.11 (0xb86e3000)
        libgpg-error.so.0 => /usr/pkg/lib/libgpg-error.so.0 (0xb874f000)
        libsocket.so.2 => /lib/libsocket.so.2 (0xb8752000)
        libxslt.so.1 => /usr/pkg/lib/libxslt.so.1 (0xb8781000)
        libxml2.so.2 => /usr/pkg/lib/libxml2.so.2 (0xb87b1000)
        libz.so.1 => /usr/pkg/lib/libz.so.1 (0xb88c4000)
        libiconv.so.2 => /usr/pkg/lib/libiconv.so.2 (0xb88d5000)
        libffi.so.5 => /usr/pkg/lib/libffi.so.5 (0xb89b4000)
        libtasn1.so.3 => /usr/pkg/lib/libtasn1.so.3 (0xb89b7000)
        libintl.so.3 => /usr/pkg/lib/libintl.so.3 (0xb89c6000)
        libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)
bash-4.0#

1. -fgnu-runtime   => this is correct ?
2. I work on x86 PC , QNX 6.4.1 (32 bit), CPU Intel Core2 Quad  Q6600 2.40
GHz 
3. and this is not the mistake:

[gnustep]/libs/base/trunk/Source/NSObject.m
@interface      NSZombie
{
  Class isa;
}
- (Class) class;
.................
@end
but 
@implementation NSZombie
- (Class) originalClass => is it correct ?
{
  return NSMapGet(zombieMap, (void*)self);
}
.................


David Chisnall wrote:
> 
> Hi,
> 
> This error will appear if the first instance variable in a class  
> appears before the end of the last instance variable in the  
> superclass.  In this case, the first instance variable is a 'struct  
> stat' and it is (apparently) overlapping with the isa pointer.
> 
> It's not clear from your post.  Are you linking against both libobjc2  
> (which installs itself as libobjc.so.4) and against GCC libobjc  
> (libobjc.so.3 or libobjc.so.2)?  If so, then you can expect things to  
> break quite badly, because both export the same symbols.  Please use  
> one or the other, not both.  If this is not the problem then...
> 
> Both NSObject and GSAttrDictionary are part of -base, so you will have  
> compiled them with the same compiler.  The problem is therefore not an  
> issue of mismatched compilers, but it may well be something related to  
> the ABI handling in clang.  The ivar offset calculation code is not  
> yet particularly well tested beyond x86 *NIX platforms.  It is  
> possible that there is a bug.
> 
> I've just added a bit more debugging code to libobjc2, so it will tell  
> you what the name and offsets of the offending ivars are.  Please can  
> you run the new version and see what the message is?  Please can you  
> also let me know what architecture you are using, so I can check that  
> clang is generating the correct IR?
> 
> You can also comment out line 787 in libobjc2's init.c.  This will  
> revert to the behaviour of the older versions of libobjc and see if  
> things actually break.
> 
> David
> 
> On 3 Jan 2010, at 19:33, bbceler wrote:
> 
>>
>> I finished works on porting LLVM and clang on QNX recently. I also  
>> compiled
>> libobjc2 from GNUstep. clang compiles without problems programs in  
>> C. I make
>> the tests of the compilation of programs in objc 2.0. That programs  
>> do not
>> use GNUstep one compiles and they work without problems.
>> I have however the problem with compiling programs using GNUstep.  
>> Programs
>> compiles but while starting the mistake appears:
>> ./autogsdoc
>> Error: Instance variables in GSAttrDictionary overlap superclass
>> NSObjectThis probably means that you are subclassing a class from a  
>> library,
>> which has changed in a binary-incompatible way.
>> Abort (core dumped)
>> Because I compiled gnustep-base use gcc runtime I thought that  
>> should this
>> gnustep-base compile also with the use of clang. I compiled the  
>> library
>> gnustep-base using clang and libobjc2.
>> The effect is the same unfortunately. I did not have problems with  
>> programs
>> in objc 1.0 and GNUstep.
>> Can the problem come into being because of the conflicts gcc libobjc  
>> with
>> the library libobjc2 from GNUstep ?
>>
>>
>> -- 
>> View this message in context:
>> http://old.nabble.com/QNX---GNUstep-and-Objective-C-tp26047107p27004526.html
>> Sent from the GNUstep - General mailing list archive at Nabble.com.
>>
>>
>>
>> _______________________________________________
>> Discuss-gnustep mailing list
>> Discuss-gnustep@gnu.org
>> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> 
> -- Send from my Jacquard Loom
> 
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> 
> 

-- 
View this message in context: 
http://old.nabble.com/QNX---GNUstep-and-Objective-C-tp26047107p27026421.html
Sent from the GNUstep - General mailing list archive at Nabble.com.





reply via email to

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