Using Linux shared libraries

Norikatsu Shigemura nork at FreeBSD.org
Tue Jan 17 04:35:21 PST 2006


On Tue, 17 Jan 2006 00:01:17 +0100
Ondra Knezour <knezour at weboutsourcing.cz> 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.


More information about the freebsd-emulation mailing list