[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple definition of gnulib symbols
From: |
Simon Josefsson |
Subject: |
Re: Multiple definition of gnulib symbols |
Date: |
Thu, 26 Apr 2007 12:37:04 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.98 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Simon Josefsson wrote:
>> But yes, gc-libgcrypt and gc-gnulib are intended to be two mutually
>> exclusive modules, since they provide the same symbols
>
> ... except for gc_hash_hmac_setkey.
Would implementing that function in gc-gnulib.c solve the problem?
>> I had no idea that defining multiple symbols in a single object
>> file could lead to trouble. Sigh.
>
> That alone is not a problem. But if you have two object files with
> _different_ but _overlapping_ set of symbols, you are in trouble.
> Say, first.o defines 'aaa', and second.o defines 'aaa' and 'bbb'.
> Then, when you link these:
>
> cc (an object or library needing aaa) \
> (a library containing first.o) \
> (an object or library needing bbb) \
> (a library containing second.o)
>
> you will get an error, because the linker will
> - see that it needs aaa, thus include first.o in the link,
> - see that it needs bbb, thus include second.o in the link,
> - and therefore give an error.
> The linker does *not* remove first.o from the link when it decides to include
> second.o.
Aha, that makes more sense to me. It seems this is a gc-design problem
then. Perhaps there should be some #define's happening, mapping the
function names to gnulib_gc_* or into libgcrypt_gc_*, and have the files
implement those symbols.
I'm wondering if that will be sufficient. When is the namespace change
hack that you mentioned Ralf identified necessary?
Thanks,
Simon
Re: Multiple definition of gnulib symbols, Simon Josefsson, 2007/04/26