gnustep-dev
[Top][All Lists]
Advanced

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

Re: Further problems trying to build GNUstep with blocks/properties supp


From: David Chisnall
Subject: Re: Further problems trying to build GNUstep with blocks/properties support
Date: Mon, 21 Jun 2010 14:43:58 +0100

On 21 Jun 2010, at 14:37, Thomas Davie wrote:

> Hi,
> 
> I think I've got a bit further with having a working GNUstep install, but 
> I've not got all the way there yet.
> 
> The version of clang that David suggested has the same issue with 
> non-termination for me, because of that, I've dropped back to using gcc-4.4.3.
> 
> I'm getting some fairly major problems trying to get a working libobjc though.
> • If I try to link against /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libobjc.a I 
> get this error building gnustep-base:
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libobjc.a(archive.o): 
> relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a 
> shared object; recompile with -fPIC

This is caused by your trying to link the static version of libobjc against a 
dynamic library.  Don't do that.  Use the .so, not the .a.

> • If I try to link against /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libobjc.so I 
> get this error building gnustep-base:
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libobjc.so: undefined 
> reference to `__gxx_personality_v0'
> ../Source/./obj/libgnustep-base.so: undefined reference to 
> `objc_get_stream_class_version'
> ../Source/./obj/libgnustep-base.so: undefined reference to `objc_verror'
> ../Source/./obj/libgnustep-base.so: undefined reference to 
> `__objc_add_class_to_hash'
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libobjc.so: undefined 
> reference to `std::terminate()'
> collect2: ld returned 1 exit status

This is caused by your compiler doing something stupid.  It looks like an old 
bug in clang, which I fixed some weeks ago, where the C++ personality function 
was always used, rather than the C one, for C exception handling.

> • If I install libobjc from http://svn.gna.org/svn/gnustep/libs/libobjc, then 
> gnustep-base builds, but I don't get the symbols for blocks, so my eventual 
> build of my project fails, specifically like this:
> ./obj/BDS.obj/Classes/Database/BDDatabase.m.o:(.data.rel+0x4c0): undefined 
> reference to `__gnu_objc_personality_v0'
> ./obj/BDS.obj/Classes/Network/BDServerSession.m.o: In function 
> `_i_BDServerSession__findExistingOrCreateGameMatchingStats_failureReason_':
> /home/tatd2/Documents/Battle Dungeon/Classes/Network/BDServerSession.m:231: 
> undefined reference to `_NSConcreteStackBlock'
> ./obj/BDS.obj/Classes/Network/BDServerSession.m.o:(.data.rel+0x460): 
> undefined reference to `__gnu_objc_personality_v0'
> ./obj/BDS.obj/Classes/Network/BDRequest.m.o:(.data.rel+0x170): undefined 
> reference to `__gnu_objc_personality_v0'
> ./obj/BDS.obj/Classes/Server/BDConfig.m.o:(.data.rel+0x130): undefined 
> reference to `__gnu_objc_personality_v0'
> ./obj/BDS.obj/Classes/Server/BDConnectionManager.m.o:(.data.rel+0x250): 
> undefined reference to `__gnu_objc_personality_v0'
> ./obj/BDS.obj/Classes/Server/BDConnection.m.o:/home/tatd2/Documents/Battle 
> Dungeon/Classes/Server/BDConnection.m:211: more undefined references to 
> `BN_clear_free' follow
> ./obj/BDS.obj/Classes/Model/Immutable/Folder.m.o:(.data.rel.ro+0x0): 
> undefined reference to `_NSConcreteGlobalBlock'
> ./obj/BDS.obj/Classes/Model/Immutable/Script.m.o: In function 
> `_i_Script__newNodePosition':
> /home/tatd2/Documents/Battle Dungeon/Classes/Model/Immutable/Script.m:204: 
> undefined reference to `_NSConcreteStackBlock'
> collect2: ld returned 1 exit status

That libobjc is ancient.  It's only meant to be used with GCC 2.x, which 
shipped with a broken libobjc.  Don't use it.  Not sure why you don't get 
_NSConcreteStackBlock defined though; it should be defined in the ObjectiveC2 
framework in -base.  Did you remember to reconfigure make / base between 
switching out libobjc versions?

> • If I install libojbc2 from http://svn.gna.org/svn/gnustep/libs/libobjc2, 
> then gnustep-base fails to configure, reporting that my objc compiler doesn't 
> produce valid output:
> checking whether objc really works... no
> I don't seem to be able to use your Objective-C compiler to produce
> working binaries!  Please check your Objective-C compiler installation.
> If you are using gcc-3.x make sure that your compiler's libgcc_s and libobjc
> can be found by the dynamic linker - usually that requires you to play
> with LD_LIBRARY_PATH or /etc/ld.so.conf.
> Please refer to your compiler installation instructions for more help.
> configure: error: The Objective-C compiler does not work or is not installed 
> properly.

This sounds like an error that happened with old versions of base's configure 
program.  Richard fixed it some months ago.

> I'm really not sure where I need to go from here.  Exactly which libraries 
> should I be building in what order to get this all to work nicely?

If you want new features, you should be using the trunk version of everything.  
Mixing random versions of stuff may or may not work - in your case, it seems 
option 2...

David

-- Send from my Jacquard Loom




reply via email to

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