From owner-freebsd-ports@FreeBSD.ORG Sat Nov 3 13:04:40 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 C8D26D1F for ; Sat, 3 Nov 2012 13:04:40 +0000 (UTC) (envelope-from peter@netkey.at) Received: from xena.netkey.at (xena.netkey.at [83.64.50.179]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7308FC0A for ; Sat, 3 Nov 2012 13:04:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by xena.netkey.at (Postfix) with ESMTP id E926C8C2804 for ; Sat, 3 Nov 2012 13:59:27 +0100 (CET) Received: from xena.netkey.at ([127.0.0.1]) by localhost (xena.netkey.at [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 35370-10 for ; Sat, 3 Nov 2012 13:59:19 +0100 (CET) Received: from xena.netkey.at (localhost [127.0.0.1]) (Authenticated sender: peter@netkey.at) by xena.netkey.at (Postfix) with ESMTPA id DF6878C2803 for ; Sat, 3 Nov 2012 13:59:18 +0100 (CET) Received: from chello084112169112.22.11.vie.surfer.at ([84.112.169.112]) by xena.netkey.at with HTTP (HTTP/1.1 POST); Sat, 03 Nov 2012 13:59:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 03 Nov 2012 13:59:18 +0100 From: Peter Klett To: Freebsd Ports Subject: net-p2p/retroshare VoIP plugin: Undefined symbol Organization: netkey information technology gmbh Message-ID: <042f62cef98b0499e960bfe3e7f15fff@netkey.at> X-Sender: peter@netkey.at User-Agent: Roundcube Webmail/0.8.2 X-Virus-Scanned: Maia Mailguard 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 13:04:41 -0000 Hi All, I'm currently trying to get the VoIP plugin from RetroShare to work under FreeBSD. After this patch I was able to build it: --- plugins/VOIP/services/rsvoipitems.cc~ 2012-02-26 18:13:54.000000000 +0100 +++ plugins/VOIP/services/rsvoipitems.cc 2012-10-29 12:53:56.650925587 +0100 @@ -182,7 +182,7 @@ ok &= setRawUInt32(data, tlvsize, &offset, flags); ok &= 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 += data_size ; if (offset != tlvsize) But I can't get RetroShare to load it: Cannot open plugin: /home/user/.retroshare/extensions/libVOIP.so: Undefined symbol "_ZN9p3Service7receiveEP9RsRawItem" Now the symbol is part of the RetroShare binary: $ grep _ZN9p3Service7receiveEP9RsRawItem work/trunk/retroshare-gui/src/RetroShare Binary file work/trunk/retroshare-gui/src/RetroShare matches but somehow the symbols from the main binary do not get exported to the plugin. The FreeBSD man page for dlopen(3) states in the NOTES section ELF executables need to be linked using the -export-dynamic option to ld(1) for symbols defined in the executable to become visible to dlsym(). So I rebuilt RetroShare with the -export-dynamic option, and the symbol is part of the symbol table: $ objdump -t work/trunk/retroshare-gui/src/RetroShare | grep _ZN9p3Service7receiveEP9RsRawItem 0000000000809580 g F .text 00000000000000c7 _ZN9p3Service7receiveEP9RsRawItem but still to no avail (same undefined symbol error). My knowledge of ELF binaries is pretty sparse, so if someone has more clues, I would appreciate sharing :) Thanks Peter