[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linking/runtime problems with non-system compiler
From: |
Richard Frith-Macdonald |
Subject: |
Re: linking/runtime problems with non-system compiler |
Date: |
Wed, 10 Jun 2015 10:10:18 +0100 |
On 10 Jun 2015, at 09:38, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
>
> Hi,
>
> I am compiling GNUstep on OpenBSD using a more modern GCC version than the
> system one. If other systems do not change library versions though this
> problem is more general.
>
> I have compiled with CC=egcc , nothing more.
>
> At when I run a program, I get:
>
> $ plparse
> plparse:/System/Library/Libraries/libgnustep-base.so.1.24:
> /usr/lib/libobjc.so.6.0 : WARNING: symbol(__objc_class_name_Protocol) size
> mismatch, relink your program
> plparse:/System/Library/Libraries/libgnustep-base.so.1.24:
> /usr/lib/libobjc.so.6.0 : WARNING: symbol(__objc_class_name_Object) size
> mismatch, relink your program
> plparse:/System/Library/Libraries/libgnustep-base.so.1.24: undefined symbol
> '__objc_msg_forward2'
> Segmentation fault (core dumped)
>
>
>
> I think the main problem is that gcc 4.9 should have bumped the revision of
> the libobjc library, since it is no longer compatible.
> $ ldd /System/Tools/plparse
> /System/Tools/plparse:
> Start End Type Open Ref GrpRef Name
> 000019de13a00000 000019de13e04000 exe 1 0 0 /System/Tools/plparse
> 000019e0929c4000 000019e0933bd000 rlib 0 1 0
> /System/Library/Libraries/libgnustep-base.so.1.24
> 000019e0a3673000 000019e0a3a95000 rlib 0 2 0
> /usr/lib/libobjc.so.6.0
> <...>
>
> At runtime ldd resolves to /usr/lib which is the system compiler which is
> older (4.2, IIRC) while the correct libobjc.so.6.0 is in /usr/local/lib
>
> Can this be solved/worked around? The path to libobjc should be embedded,
> perhaps -R as a linker flag or some other trick?
There are two approaches that I think should work ...
1. configure gnustep-make using LIB_DIR=-L/usr/local/lib to change the order of
linking
2. put the library you want to use inside the gnustep filesystem, so when you
configure gnustep-make it will find it first.