LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 09-22-2002, 03:36 AM   #1
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
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
 
Old 10-02-2002, 11:24 AM   #2
bsdjunkie
Member
 
Registered: Sep 2002
Distribution: slack
Posts: 39

Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb "not in executable format: File format not recognized" tcma Programming 9 07-18-2007 06:02 AM
kernel 2.6.3 compile ends in grub error 13: unsupported executable format(?) browny_amiga Linux - General 4 03-06-2004 02:33 PM
use vi to convert linux format to windows format intolinux Linux - Software 2 12-10-2003 10:20 PM
running windows executable in linux anamika123 Linux - Software 8 06-05-2003 12:31 PM
About amiga format to linux format? 45pferde Linux - General 0 08-12-2001 07:06 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration