From owner-freebsd-emulation@FreeBSD.ORG Tue Jan 17 12:35:21 2006 Return-Path: X-Original-To: freebsd-emulation@FreeBSD.org Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80AB016A41F; Tue, 17 Jan 2006 12:35:21 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id D275843D46; Tue, 17 Jan 2006 12:35:20 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.4/8.13.4/NinthNine) with ESMTP id k0HCZILU020580; Tue, 17 Jan 2006 21:35:19 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Tue, 17 Jan 2006 21:35:18 +0900 From: Norikatsu Shigemura To: Ondra Knezour Message-Id: <20060117213518.3f2ed1a4.nork@FreeBSD.org> In-Reply-To: <43CC25BD.3070100@weboutsourcing.cz> References: <43CC25BD.3070100@weboutsourcing.cz> X-Mailer: Sylpheed version 2.2.0beta4 (GTK+ 2.8.10; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (sakura.ninth-nine.com [219.127.74.121]); Tue, 17 Jan 2006 21:35:19 +0900 (JST) Cc: freebsd-emulation@FreeBSD.org, nork@FreeBSD.org Subject: Re: Using Linux shared libraries X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2006 12:35:21 -0000 On Tue, 17 Jan 2006 00:01:17 +0100 Ondra Knezour wrote: > Tried to brand them as linux binaries as first step, but this solution > wasn't successfull, as expected. Later I found some discussion > confirming my expectation, that this mixing of bsd and linux binaries is > simply impossible. Yes, really exactly! > Then I tried to make plugin wrapper using www/linuxpluginwrapper port with > make dummy.c TARGET_PLUGIN=target_plugin_path > mv dummy.c debug/dummy_plugin_name.c > add plugin to Makefile and debug/Makefile.inc > make target_plugin install To do a try and error, dummy.c is a template file. > for both plugin files. I got two requested files installed, created > symlink to them form Firebird UDF directory, but I haven't any succes to > run Firebird server with them. Server is randomly not responding, dying > silently, sometimes with ERR10 - No child process (watched with truss). > My questions: > Is there some usefull reading about using linux plugins for bsd > applications? > Is there any how-to for linuxpluginwrapper or usefull discussion thread? No. If there are them, freebsd-ports@ and freebsd-emulation@ are so. > I looked at some port which use this plugin, but I don't feel myself > fully understanding this tool, especially how to found which additional > files should be specified in plugin_nameOBJ variable in Makefile. Sorry my poor Makefile:-(. > Which way is sugested for watching calls and responses between executed > binary and shared library? I use truss -fae, but there must be something > more usefull for this situation. GDB will probably do what I expect, but > if there is wide consensus about debugging this scenario, I want to know > which one it is. I use ktrace and printf(write(2)?) debug. > Another way may be possible - decompile linux file and compile it on > FreeBSD. I have some asm-like decompiled files for mentioned libraries, > but assembler isn't my best friend, so I want to ask, if this way may be > successfull and if can, which method and tools can lead to success. Maybe, license will not forbid by decompile you said. > dummy.c files generated for libraries > http://gw.weboutsourcing.cz/fb/dummy_udfs_00.c > http://gw.weboutsourcing.cz/fb/dummy_udfs_01.c dummy.c is a simple hook functions. If a function in dummy.c is called, put called function name and ASAP abort program. And you decide to write new one as Linux function <=> FreeBSD function, mutually conversion function, or pass through.