From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 11 18:48:08 2005 Return-Path: X-Original-To: hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E82C16A41F; Thu, 11 Aug 2005 18:48:08 +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 8A7BC43D46; Thu, 11 Aug 2005 18:48:07 +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.3/8.13.3/NinthNine) with SMTP id j7BIlUvQ085453; Fri, 12 Aug 2005 03:47:31 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Fri, 12 Aug 2005 03:47:30 +0900 (JST) Message-Id: <200508111847.j7BIlUvQ085453@sakura.ninth-nine.com> From: Norikatsu Shigemura To: "M. Warner Losh" In-Reply-To: <20050811.104604.61335403.imp@bsdimp.com> References: <20050809.133734.08360256.imp@bsdimp.com> <20050809213130.GB71687@dan.emsphone.com> <20050811.104604.61335403.imp@bsdimp.com> X-Mailer: Sylpheed version 2.0.0 (GTK+ 2.6.9; 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 (sakura.ninth-nine.com [219.127.74.121]); Fri, 12 Aug 2005 03:47:31 +0900 (JST) Cc: hackers@FreeBSD.org, dnelson@allantgroup.com, ume@FreeBSD.org Subject: Re: Converting libfoo.so for linux to freebsd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2005 18:48:08 -0000 Linuxpluginwrapper(LPW) is a most famous killer application of libmap.conf(5)! (I think:-) On Thu, 11 Aug 2005 10:46:04 -0600 (MDT) "M. Warner Losh" wrote: > Here's a breif outline of what I've learned: > (1) To remove the symbol versioning goo from a shared library, > objcopy -R .gnu.version linux.so freebsd.so > (there's also a .gnu.version_r on some libraries, that can > also be removed this way). Doing this allows one to directly > link the .so into your program, modulo ABI issues. Humm, When I made LPW, I didn't have a trouble about symbol versioning. I think no need objcopy. > (2) dlopen (and likely ld-elf.so in general) doesn't check the > version information at all. If all you are doing is linking > dynamically at run time, you don't have to perform step #1. > The compile time linker, however, whines about missing symbol > versions. > (3) Use libmap.conf to map libc.so.6 for the shared library > that you are loading to overcome ABI issues. See the man page > for an example. Humm.. I have no comment. > The linuxplugwrapper port can be used to generate shims for the ABI > issues, in general, and works well. I'll likely not use it for the > brother scanner port I'm working on since all I need is stderr defined > in a linuxly correct, and I can do that in the source part of the > driver. I'd love to get the network side of things working, but I > think that might be more effort than I care to go to at the moment. > I'd also like to get faxing and printing working, but again, time... > I bought it for the 35 sheet document feeder + scanner at $100.00 > after rebate :-) LPW has a FORCE ABOUTER[TM:-)]. $ cd /usr/ports/www/linuxpluginwrapper $ make extract $ cd work/linuxpluginwrapper-20050613 $ make dummy.c TARGET_PLUGIN=LINUX_SHARED_LIBRARY_YOU_WANT.so $ mv dummy.c dummy_APPLICATION_NAME.c please add dummy_APPLICATION_NAME.o and related macros to Makefile on top directory. So you can develop pluginwrapper like acrobat/flash7/realplayer support:-).