From owner-freebsd-questions@FreeBSD.ORG Tue Feb 19 13:58:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E5E16A46B for ; Tue, 19 Feb 2008 13:58:02 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 34D7613C465 for ; Tue, 19 Feb 2008 13:58:02 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so668866nfb.33 for ; Tue, 19 Feb 2008 05:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=qp0lNyA9Am4kZMUX3yDjGukhWMnyTS5jxkABBbEKBeI=; b=iUJtOLmDxGcp0QyYe8gS2DzotA7MremthtHHGnbFFEbh3tlYud3Z1Zg4lOHe72ytoOzQ/WFcHph75XM5YPRVs3Iedo1F/z/7/96obAV3kBN5sXHqmMdJc7fZcT/QsNup0wDH7/ZEVr1vV06i5PXdqw1Fy1OP+w/zZPbrptDeM6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Fl5CpGqiUnYhS8i06wDPdO4HOWdMMB3+FKJ5cFeYKBql8m4nfyrFaNeDDVR4iRfWaqi/4TOg1lo9rFf0qhC9nFGPZBQaGQ/LOE3J6jSnzbB3aRxb9CvPOrcjJgikQw+4DPIFccFp/TjONAMWJJo48jEP5yWMIs4awt48zTfGyP0= Received: by 10.150.138.8 with SMTP id l8mr2511048ybd.72.1203429479892; Tue, 19 Feb 2008 05:57:59 -0800 (PST) Received: by 10.150.148.8 with HTTP; Tue, 19 Feb 2008 05:57:59 -0800 (PST) Message-ID: <1563a4fd0802190557l46bd6984x29e8f04b1ceed311@mail.gmail.com> Date: Tue, 19 Feb 2008 19:27:59 +0530 From: "navneet Upadhyay" To: freebsd-questions@freebsd.org, "Dominic Fandrey" In-Reply-To: <47BA7A91.8060707@bsdforen.de> MIME-Version: 1.0 References: <1563a4fd0802180712w476125a4x229cc38509016b94@mail.gmail.com> <47B9A31B.7060602@bsdforen.de> <1563a4fd0802180813l7d80cb4en9adfd838f4591712@mail.gmail.com> <47B9C8D8.5060807@bsdforen.de> <1563a4fd0802182115xf64b634yd361a78ba0c8ff68@mail.gmail.com> <47BA7A91.8060707@bsdforen.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: 32 bit and 64 bit freebsd binary compatiblty X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 13:58:02 -0000 Binary compiled on 32 bit not running on 64 bit machine. Actually i am using *sysctl* call and the *kinfo_proc* structure from user.hin include/sys , size of structure on 32bit is 768 and on 64 bit is around 1180 and thats why the call is failing and application coredumping. Can anyone tell how do we handle this situation??? Is there any way or i have to compile my code on 64 bit machine?? Keep in mind there can be many such structure.. Thanks, Navneet On 2/19/08, Dominic Fandrey wrote: > > navneet Upadhyay wrote: > > On 2/18/08, Dominic Fandrey wrote: > >> navneet Upadhyay wrote: > >>> On 2/18/08, Dominic Fandrey wrote: > >>>> navneet Upadhyay wrote: > >>>>> Hi , > >>>>> For our product we generally compile the binaries on 32 bit > >>>> systems > >>>>> and use them for both 32 and 64 bit systems. like we have same > >> binaries > >>>> for > >>>>> 32 bit and 64 bit RHEL. > >>>>> > >>>>> We are porting the product to FreeBSD and when we tried the same, > >>>>> i.erunning binaries compiled on 32 bit FreeBSD > >>>>> 6.2 on 64 bit FreeBSD system they produce *core dump.* > >>>>> > >>>>> > >>>>> Any known reasons, do we have to compile binaries on 64 bit machine. > >>>> This should not happen. I would blindly guess at a linking problem. > Are > >>>> you > >>>> using any shared libraries that do not belong to the base system? > >>>> > >>> Yes i am using few libs not built on FreeBSD but they work fine on 32 > >> bit > >>> freeBSD , so in principle they shud have the same behavior on 64 one. > >> I suppose you are aware that they have to be 32-Bit libraries as well, > for > >> your 32-Bit application to work? > >> > > I didnt get what do you mean. > > > > Do you mean : > > > > I should install lib32 on freeBSD and then rebuild my applications in > order > > to make it work on 32 and 64 bit systems . > > > > rite now I have built my app on 32 bit system (which is not having lib32 > > installed), it works on 32 bit freebsd but fails on 64 bit system. > > The app needs 32-Bit libraries tu run on 64 Bit. I suggest you link your > program statically against libraries that are not part of the base system. > That way everything should run just fine. >