0

I wrote some code for linux/unix(ld_preload), how can i compile it for FreeBSD on my Ubuntu Server using G++, or maybe other compiler?

Thanks!

Robert
  • 487
  • 2
  • 8
  • 18

2 Answers2

4

No need to recompile: there's a shim for the differences that's a little more tightly integrated than just a compat library. Some linux-only facilities you'll need to avoid, and you do need to 'brand' the linux binaries w/ brandelf, your starting point is that link.

jthill
  • 42,819
  • 4
  • 65
  • 113
3

My recommendation would be to create a FreeBSD virtual machine (using software like virtualbox) and compile the code on that.

Whyrusleeping
  • 769
  • 2
  • 7
  • 20