Compile differences between Linux and FreeBSD - Unix

This is a discussion on Compile differences between Linux and FreeBSD - Unix ; I have a program that runs fine on FreeBSD but yesterday I transferred it over to a linux box and it failed. (Actually it's a web server on a shared host). What is happening is a run time linker utility ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Compile differences between Linux and FreeBSD

  1. Compile differences between Linux and FreeBSD

    I have a program that runs fine on FreeBSD but yesterday I transferred
    it over to a linux box and it failed. (Actually it's a web server on a
    shared host). What is happening is a run time linker utility is in /
    libexec but that path does not exist in Linux and, perhaps, not even
    that utility, don't know.

    The utility is ld-elf.so.1. It tries to call in some run-time
    libraries, I guess. I tried to compile it with gcc -static but it
    still fails to run.

    This little app only does a short series of 'printf's' and nothing
    else.

    I tried all this right before going to bed so I haven't looked into it
    yet. Hoping someone here might have a ready solution. In the meantime,
    I'm going to fire up one of my boxes and reinstall Linux on it.
    Perhaps just copying the code to there and recompiling will solve the
    issue.

  2. Re: Compile differences between Linux and FreeBSD

    I compiled this little program with Knoppix and it worked but I'm
    still wondering if anyone would know of a workaround so I don't have
    to run to a Linux boxevery time.

  3. Re: Compile differences between Linux and FreeBSD

    On Wed, 23 Apr 2008 06:00:14 -0700 (PDT), drhowarddrfine wrote:
    > I have a program that runs fine on FreeBSD but yesterday I transferred
    > it over to a linux box and it failed. (Actually it's a web server on a
    > shared host). What is happening is a run time linker utility is in /
    > libexec but that path does not exist in Linux and, perhaps, not even
    > that utility, don't know.
    >
    > The utility is ld-elf.so.1. It tries to call in some run-time
    > libraries, I guess. I tried to compile it with gcc -static but it
    > still fails to run.


    Did you actually *recompile* the program on Linux, or did you just
    transfer the ELF binary from FreeBSD to Linux?


  4. Re: Compile differences between Linux and FreeBSD

    drhowarddrfine writes:
    >I compiled this little program with Knoppix and it worked but I'm
    >still wondering if anyone would know of a workaround so I don't have
    >to run to a Linux boxevery time.


    Linux and FreeBSD in general aren't binary comptible.

    You'll have to recompile it on either platform.

    You can runup either OS in Xen or any other virtualization program or
    whatever works on your main platform.




  5. Re: Compile differences between Linux and FreeBSD

    On Apr 23, 1:54 pm, Doug McIntyre wrote:
    >
    > You'll have to recompile it on either platform.
    >


    On either platform? Don't know what you mean. I believe I'll have to
    develop on fbsd and recompile on Linux if I choose to do it that way.

    I have 50 bazillion computers in my basement. Given to me by Windows
    users upgrading.
    Haven't bought a new computer since 1999.

  6. Re: Compile differences between Linux and FreeBSD

    Doug McIntyre wrote:
    > drhowarddrfine writes:
    >> I compiled this little program with Knoppix and it worked but I'm
    >> still wondering if anyone would know of a workaround so I don't have
    >> to run to a Linux boxevery time.

    >
    > Linux and FreeBSD in general aren't binary comptible.


    Actually FreeBSD has a feature such that it can run Linux binaries (a
    kernel module that remaps the system call vector or some such). But
    there's no such thing in reverse. Thus it might be easiest to compile on
    Linux and run on either. Or to develop in Java :-)

    RM

  7. Re: Compile differences between Linux and FreeBSD

    On Apr 24, 12:24 am, Rex Mottram wrote:
    > Doug McIntyre wrote:
    > > drhowarddrfine writes:
    > >> I compiled this little program with Knoppix and it worked but I'm
    > >> still wondering if anyone would know of a workaround so I don't have
    > >> to run to a Linux boxevery time.

    >
    > > Linux and FreeBSD in general aren't binary comptible.

    >
    > Actually FreeBSD has a feature such that it can run Linux binaries (a
    > kernel module that remaps the system call vector or some such). But
    > there's no such thing in reverse. Thus it might be easiest to compile on
    > Linux and run on either. Or to develop in Java :-)

    Or use the simple standard procedure of compiling the code.
    Stick to POSIX and it shouldn't matter whether you compile on freebsd
    or linux or hp-ux.
    It will also most likely run on more exotic systems than what Java can
    afford.


+ Reply to Thread