From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 9 21:31:39 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 B9D7416A41F for ; Tue, 9 Aug 2005 21:31:39 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B5434448D for ; Tue, 9 Aug 2005 21:31:39 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j79LVUYY022367; Tue, 9 Aug 2005 16:31:30 -0500 (CDT) (envelope-from dan) Date: Tue, 9 Aug 2005 16:31:30 -0500 From: Dan Nelson To: "M. Warner Losh" Message-ID: <20050809213130.GB71687@dan.emsphone.com> References: <20050809.133734.08360256.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050809.133734.08360256.imp@bsdimp.com> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: hackers@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: Tue, 09 Aug 2005 21:31:39 -0000 In the last episode (Aug 09), M. Warner Losh said: > I have recently purcahsed a device that comes with a .so for linux, > but no sources. Is there any way one can take an arbitrary linux .so > which appears to have no dependencies to a FreeBSD .so? The binary > code is about 20k or so. As long as any structs that are passed back and forth have the same members and alignment, it should work. This includes struct FILE, which means if the app tries to use stdio it'll likely crash. I just compiled a little "hello world" object file on SUSE and linked it on FreeBSD and it ran (it just calls printf, which is safe since it doesn't pass a FILE *). -- Dan Nelson dnelson@allantgroup.com