Thanks for the reply. I spoke with Ian Taylor (the author of gold) and
his response was as follows:
> I did some more testing, and it appears that when the dynamic linker
> sees a symbol with no version in an executable, it will link it to the
> symbol defined with the first version in the shared library. So there
> is no need for the SYM@ syntax as far as I can see; the right thing to
> do to make tihs work is to put the original symbol in the first version
> listed in the version script.
So I have attached a patch that allows fuse-2.7.4 to link with gold.
Note that there are two problems addressed here:
* Use of the symver directive without a version specified. This is
fixed by assigning these symbols to a version FUSE_UNVERSIONED which
appears first in the linker script.
* If __FreeBSD__ is not defined, fuse_chan_new_compat24 is bound to
fuse_chan_new@... (in fuse_session.c), however the version script
also includes fuse_chan_new in FUSE_2.4 so two different versions of
the function are effectively bound and it is ambiguous which should be
used. GNU ld doesn't complain about this but gold does. This is fixed
by removing fuse_chan_new@... from the version script and
explicitly exporting it in fuse_session.c when __FreeBSD__ is defined.
Thanks,
Raymes
On Wed, Sep 22, 2010 at 6:06 AM, Miklos Szeredi <miklos@...> wrote:
> On Wed, 15 Sep 2010, Raymes Khoury wrote:
>> I'm trying to compile fuse with the gold linker.
>>
>> I'm getting the following error:
>> libtool: link: i686-pc-linux-gnu-gcc -shared .libs/fuse.o
>> .libs/fuse_kern_chan.o .libs/fuse_loop.o .libs/fuse_loop_mt.o
>> .libs/fuse_lowlevel.o .libs/fuse_mt.o .libs/fuse_opt.o
>> .libs/fuse_session.o .libs/fuse_signals.o .libs/cuse_lowlevel.o
>> .libs/helper.o .libs/subdir.o .libs/iconv.o .libs/mount.o
>> .libs/mount_util.o -lrt -ldl -L/build/x86-generic/lib
>> -L/build/x86-generic/usr/lib -march=core2 -mtune=generic -mfpmath=sse
>> -pthread -Wl,--version-script -Wl,./fuse_versionscript -pthread
>> -Wl,-soname -Wl,libfuse.so.2 -o .libs/libfuse.so.2.8.1
>> /usr/libexec/gcc/i686-pc-linux-gnu/ld: warning: using 'FUSE_2.4' as
>> version for 'fuse_chan_new' which is also named in version 'FUSE_2.6'
>> in script
>> /usr/libexec/gcc/i686-pc-linux-gnu/ld: error: .libs/fuse_session.o:
>> multiple definition of 'fuse_chan_new'
>> /usr/libexec/gcc/i686-pc-linux-gnu/ld: .libs/fuse_session.o: previous
>> definition here
>> /usr/libexec/gcc/i686-pc-linux-gnu/ld: error: symbol __fuse_exited has
>> undefined version
>> collect2: ld returned 1 exit status
>>
>> I'm interested in the second error:
>> /usr/libexec/gcc/i686-pc-linux-gnu/ld: error: symbol __fuse_exited has
>> undefined version
>>
>> This is caused by the following directive in fuse.c:
>> FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
>> Unfortunately it is not clear in GNU ld what the behavior should be
>> when no version is specified for the symbol (or at least how not
>> specifying a version can be useful) . What was the intention of
>> including this directive (and several other similar directives)?
>
> Symbol versioning in libfuse was introduced in fuse-2.2. The first
> public release of libfuse-2 was 2.1, which had symbols without
> versions.
>
> To allow compatibility with filesystems compiled against 2.1 these
> unversioned symbols need to be provided in later versions of the
> library.
>
> Thanks,
> Miklos
>
|