Re: Undefined procedure on foreign library in 6.6.4

Eugeniy Meshcheryakov <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi,

2 квітня 2014 о 17:52 +0200 Jan Wielemaker написав(-ла):
> > -rwxr-xr-x 1 root root 1237082 Apr  2 15:20 libtestfo.so

That's a too large file. On my Debian machine the file size is around
7kB. It looks like you are linking to a static library, do you have
libswipl.a somewhere? Could you look at full "nm -D" output? I have only
12 lines here.

> Well, copy-and-pasting the commands from swipl-ld and editing them a
> little, it turns out that the fatal option is -Wl,-Bsymbolic-functions.
> Once you delete that from the link command, all works just fine. I don't
> understand why (see man ld for what the option does). It indeed does
> call the install function (verified with an Sdprintf() call in there).
> But, it seems it is not really calling PL_register_foreign() inside
> Prolog.
> 
> If I run Prolog under gdb and put a break on PL_register_foreign, it
> nicely breaks, but this seems a different PL_register_foreign(). If I
> put a breakpoint in a function called by PL_register_foreign(), it no
> longer breaks, so it indeed does not seem to be calling
> PL_register_foreign() in Prolog itself.
> 
> Before this can be fixed, we must know what is going on.  Anyone?
> 
> Maybe our Debian maintainer (Eugeniy) has an idea?
Debian is not using -Wl,-Bsymbolic-functions flag by default, so it is
also not used to build swi-prolog here. I tried to build module manually
with this option and it had no influence, it worked fine with or without
this option. I guess the problem is with linking with a static library and
mixing symbols (like registration tables) in swipl executable and
in the loadable module.

Regards,
Eugeniy Meshcheryakov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.iai.uni-bonn.de/pipermail/swi-prolog/attachments/20140402/fdb3d5c2/attachment.bin>
_______________________________________________
SWI-Prolog mailing list
[email protected]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.