Robert
Robert

Reputation: 527

G++ how to compile for FreeBSD on linux server

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!

Upvotes: 0

Views: 1590

Answers (2)

jthill
jthill

Reputation: 60547

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.

Upvotes: 4

Whyrusleeping
Whyrusleeping

Reputation: 929

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

Upvotes: 3

Related Questions