Bill Pringlemeir wrote:
> 
> On 28 Jan 2007, [EMAIL PROTECTED] wrote:
> 
> > Unfortunately, I've been encountering an apparently new problem with
> > an undefined '___popcountsi2' symbol.  That is, the fixes for my old
> > '___popcountsi2' symbol problem have failed to prevent it.
> 
> Well, depending on what you wish to achieve, you can edit the config.h
> and comment out the line "HAS_BUILTIN_POPCOUNT".  This is only
> referenced in misc.h.  It is being use to determine if only a single
> bit is set.

We could comment it out completely in misc.h but this wouldn't give us
any clue why it fails and how to fix if it matters for something else
in the future. Also the other symbols like __udivdi3 are used transparently
by GCC and we can't disable them (without avoiding 64-bit arithmetic,
which would be insane).
 
> You may also be able to send this to Configure with 
> "-U d_built_popcount".  This should short circuit the
> U/new/d_built_popcount.U.  This script (put in Configure) is trying to
> compile this,
> 
>     int main(void)
>     {
>             static int ret;
>             ret |= __builtin_popcount(127);
>             return ret ? 0 : 1;
>     }
> 
> For some reason, this is compiling (and linking) on your system.

Yes, it would be odd and there must be something screwed if this check
succeeds but use of it causes a build failure later. I suspect there's
one or another library in the way responsible for this. If you have
multiple version of the same libraries installed with dependencies
on yet other libraries which might be installed multiple times, things
go easily wrong. I might have misunderstood but I think Mac OS's dynamic
linker mechanism has flaws that are non-existent in other Unix-like
systems, that is if there's a shared library the linker will see it,
you can't hide. Having multiple versions installed of the same library
will break things.

>  I think the code could be changed to this,
> 
>     int main(void)
>     {
>             static int ret;
>             ret |= __builtin_popcount(127);
>             return ret == 7 ? 0 : 1;
>     }
> 
> That would verify that the popcount is working correctly.

For what it's worth, the code snippets are only compiled and linked, they are
never executed, so that you can cross-compile. If the code seemingly makes
sense, that's just a coincident. There should be a check for GCC here though
because a different compiler could potentially provide the same symbol
with completely different semantics.
 
-- 
Christian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Gtk-gnutella-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to