32 bit and 64 bit freebsd binary compatiblty

navneet Upadhyay navneet.upadhyay at gmail.com
Tue Feb 19 13:58:02 UTC 2008


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 <kamikaze at bsdforen.de> wrote:
>
> navneet Upadhyay wrote:
> > On 2/18/08, Dominic Fandrey <kamikaze at bsdforen.de> wrote:
> >> navneet Upadhyay wrote:
> >>> On 2/18/08, Dominic Fandrey <kamikaze at bsdforen.de> 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.
>


More information about the freebsd-questions mailing list