poke-devel
[Top][All Lists]
Advanced

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

Re: Multiple definition errors when linking libpoke into gdb


From: Jose E. Marchesi
Subject: Re: Multiple definition errors when linking libpoke into gdb
Date: Wed, 14 Feb 2024 17:52:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

> Hannes Domani wrote:
>> When I'm trying to (statically) link libpoke into gdb, I get the following 
>> errors:
>> 
>> ... gl-libpoke/xmalloc.c:44: multiple definition of `xmalloc'; alloc.o
>> ... gdb/alloc.c:49: first defined here
>> 
>> Both gdb and gl-libpoke define these x* allocation functions, and I'm not 
>> sure how to fix this.
>
> The most reliable way to do this is to rename the said functions at the
> source code level, in the scope of poke. That is, in some .h file that
> all poke files see but that gdb does not see (such as poke/config.h),
> add definitions such as
>   #define xmalloc libpoke_xmalloc
>   #define xstrdup libpoke_xstrdup.
> Most gnulib modules respect such definitions in config.h. If you find
> a module that doesn't, please report it here.
>
> For a fixed list of symbols, this can be done through an AH_VERBATIM
> invocation in poke's configure.ac.

I think in this case it is better to not use the xalloc module in
libpoke at all.




reply via email to

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