From owner-freebsd-ports@FreeBSD.ORG Sat Nov 3 14:53:48 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26DF6BE8 for ; Sat, 3 Nov 2012 14:53:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kostikbel-1-pt.tunnel.tserv11.ams1.ipv6.he.net [IPv6:2001:470:1f14:13d6::2]) by mx1.freebsd.org (Postfix) with ESMTP id B74698FC08 for ; Sat, 3 Nov 2012 14:53:47 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA3Erhqd091402; Sat, 3 Nov 2012 16:53:43 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA3Erhn6091401; Sat, 3 Nov 2012 16:53:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Nov 2012 16:53:43 +0200 From: Konstantin Belousov To: Peter Klett Subject: Re: net-p2p/retroshare VoIP plugin: Undefined symbol Message-ID: <20121103145343.GX73505@kib.kiev.ua> References: <042f62cef98b0499e960bfe3e7f15fff@netkey.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5FNPeqk0egs0iuvD" Content-Disposition: inline In-Reply-To: <042f62cef98b0499e960bfe3e7f15fff@netkey.at> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Freebsd Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 14:53:48 -0000 --5FNPeqk0egs0iuvD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 03, 2012 at 01:59:18PM +0100, Peter Klett wrote: >=20 > Hi All, >=20 > I'm currently trying to get the VoIP plugin from RetroShare to work=20 > under FreeBSD. > After this patch I was able to build it: >=20 > --- plugins/VOIP/services/rsvoipitems.cc~ 2012-02-26=20 > 18:13:54.000000000 +0100 > +++ plugins/VOIP/services/rsvoipitems.cc 2012-10-29=20 > 12:53:56.650925587 +0100 > @@ -182,7 +182,7 @@ > ok &=3D setRawUInt32(data, tlvsize, &offset, flags); > ok &=3D setRawUInt32(data, tlvsize, &offset, data_size); > std::cerr << "data_size : " << data_size << std::endl; > - memcpy(data+offset,voip_data,data_size) ; > + memcpy(&((uint8_t*)data)[offset],voip_data,data_size) ; > offset +=3D data_size ; >=20 > if (offset !=3D tlvsize) >=20 > But I can't get RetroShare to load it: >=20 > Cannot open plugin: /home/user/.retroshare/extensions/libVOIP.so:=20 > Undefined symbol "_ZN9p3Service7receiveEP9RsRawItem" >=20 > Now the symbol is part of the RetroShare binary: >=20 > $ grep _ZN9p3Service7receiveEP9RsRawItem=20 > work/trunk/retroshare-gui/src/RetroShare > Binary file work/trunk/retroshare-gui/src/RetroShare matches >=20 > but somehow the symbols from the main binary do not get exported to the= =20 > plugin. > The FreeBSD man page for dlopen(3) states in the NOTES section >=20 > ELF executables need to be linked using the -export-dynamic option to > ld(1) for symbols defined in the executable to become visible to=20 > dlsym(). >=20 >=20 > So I rebuilt RetroShare with the -export-dynamic option, and the symbol= =20 > is part of the symbol table: >=20 > $ objdump -t work/trunk/retroshare-gui/src/RetroShare | grep=20 > _ZN9p3Service7receiveEP9RsRawItem > 0000000000809580 g F .text 00000000000000c7 =20 > _ZN9p3Service7receiveEP9RsRawItem >=20 > but still to no avail (same undefined symbol error). > My knowledge of ELF binaries is pretty sparse, so if someone has more=20 > clues, I would appreciate sharing :) The objdump -t dumps wrong table. You want to examine the output of -T AKA --dynamic-syms. --5FNPeqk0egs0iuvD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCVL/cACgkQC3+MBN1Mb4heigCfbuxC4fvHnYvaTw0bmU807NPf i3UAnixvUIVZSIoCDbADLs0TtNFOJd5F =SoYn -----END PGP SIGNATURE----- --5FNPeqk0egs0iuvD--