LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Executable format on Linux and FreeBSD (https://www.linuxquestions.org/questions/%2Absd-17/executable-format-on-linux-and-freebsd-30944/)

llama_meme 09-22-2002 03:36 AM

Executable format on Linux and FreeBSD
 
If I compiled a simple 'hello world' C program in FreeBSD, but linked it to glibc instead of FreeBSD's libc, would that be a valid Linux executable?

Alex

bsdjunkie 10-02-2002 11:24 AM

Im thinking it might work.. A quick google search shows the following:

SUBJECT: RE: compiling Linux binaries under FreeBSD?



> First of all, is it possible? Second, how would one go about doing so? I
> would assume that getting a Linux gcc binary would be a must, but do I need
> a linker as well? And anything else?
> > I`ve got a bunch of C files that I need to build a Linux library from...
> nothing more complicated than that.
> > Any help/info would be appreciated. Thanks!

Install the linux_devel package, then run /compat/linux/bin/sh. This
will do all the right things with regards to your search path, with *one*
exception.

If you run a GNU configure script (or similar), it will find the BSD
ranlib, and use that on your Linux libraries. You can circumvent this
by making an empty, executable `ranlib` file somewhere in the Linux
executable hierarchy (eg. /compat/linux/usr/bin).

Running the Linux-mode shell is fairly important; you can get by
without it for simple things, but for more complex stuff you really
want to have the right shell.




I guess ive never tried writing linux specific code on BSD b4 :p


All times are GMT -5. The time now is 03:12 AM.