# Linux binary vs FreeBSD binary



## fbsd_ (Dec 19, 2021)

I'm working on a project about recompiling Linux binaries to FreeBSD. No, I'm not talking about Linux binary compatibility. I want to do something different. I know FreeBSD and Linux are two different OSes, and it's very hard or maybe impossible to do something like that, but all fine... I will find a way. By the way, I just recompiled one of the hello world software written in c to FBSD. I need some more information about FreeBSD's binary differences.
So I have been searching for differences between FBSD and Linux binary and already found these:

1)Linked libraries are different 
2)ELF header different
..?


Note: Assume that architectures are the same(trying on x86_64)
Thanks...


----------



## Alain De Vos (Dec 19, 2021)

some info,








						Other - FreeBSD AMD64 ABI
					

Hello, background: I'm Assembly programmer for both Intel's x86 and AMD64 architectures, been programming for these architecture for more than 10 years in non-UNIX-like operating systems; to be more precise: Windows NT based operating systems.  I was able to find the numeric kernel services...




					forums.freebsd.org


----------



## drhowarddrfine (Dec 19, 2021)

You don't compile binaries but we know what you meant. It isn't hard or impossible in every situation to compile C code to FreeBSD. Especially any helloworld.c code. The problems come up with ABI compatibility and targeted code.


----------



## shkhln (Dec 19, 2021)

C ABI is the same, everything about ELF objects is exactly the same, syscall conventions are different I believe.



fbsd_ said:


> No, I'm not talking about Linux binary compatibility. I want to do something different. I know FreeBSD and Linux are two different OSes, and it's very hard or maybe impossible to do something like that, but all fine... I will find a way.


I'm getting teenage angst vibes from this 



fbsd_ said:


> By the way, I just recompiled one of the hello world software written in c to FBSD.


You did?


----------



## Alain De Vos (Dec 19, 2021)

I found this very old link,


			iBCS Emulation for Linux


----------



## fbsd_ (Dec 19, 2021)

shkhln said:


> C ABI is the same, everything about ELF objects is exactly the same, syscall conventions are different I believe.
> 
> 
> I'm getting teenage angst vibes from this
> ...


Hahah. It's hard to hide the angry teenager inside me. Don't mind it.


----------

