root@molly:~ # cd /usr/include/
root@molly:/usr/include # find . -name 'if.h'
./net/if.h
root@molly:/usr/include # find . -name 'if_packet.h'
root@molly:/usr/include # find . -name 'if_ether.h'
./netinet/if_ether.h
root@molly:/usr/include # find . -name 'if_arp.h'
./net/if_arp.h
Could you give more information how to port project from Linux to freeBSD?I mean: chances are you can isolate some parts of your software that can easily be ported to FreeBSD. And for the other parts, you can use FreeBSD's Linuxolator at runtime, and try to port them more slowly & thoughtful.
There is no "one-size-fits-all" tutorial covering this. You're going to need to do a lot of legwork yourself. And this starts by understanding how each system works.Could you give more information how to port project from Linux to freeBSD?
This tells me you have zero experience compiling anything. Let alone porting something from one system to another.Can I compile project on a Linux OS for target freebsd?
I mean that I have project on Linux and need to compile it and those compiled .bin files I want to run on the freeBSD machine. Is it possible?
pkg install {de,en}-freebsd-doc
, replace de with your native tongue, and point your favorite browser to /usr/local/share/doc/freebsd. There's a Porter's Handbook. message: "query '[%C/%n] %M'",
rmessage: query -i "[%C/%n-%v] %M",
pkg message|less
.What kind of project is that, exactly?I have no any expierence with Linux system and ask you to help me to decide problem with transfer project on the Linux to freeBSD.
It's some custom project for Linux (write on C). And I need to run this executable files on the FreeBSD.What kind of project is that, exactly?
What does it do?It's some custom project for Linux (write on C). And I need to run this executable files on the FreeBSD.
This is where experience comes in. You need to have a good understanding of the code and how it works before you can attempt to port it. Think of it as asking a mechanic friend how to improve the performance of your car without understanding how an engine works. He can tell you but you're not going to understand it.I tried to compile it on the FreeBSD but there is no some specific libraries for Linux on FreeBSD.
That depends on the project and how it's set up. Sometimes you can but most of the time your going to need to patch the code. Again, this is where experience comes in, if you know and understand what the code does you will know exactly what needs to be changed.And I find any way to cross compile this project under Linux but target for FreeBSD. Is it possible?
sysrc linux_enable=YES
. For some you need to mount Linux proc, sys or /dev/shm (or all of these) filesystems. /etc/fstab:linproc /compat/linux/proc linprocfs rw 0 0
linsys /compat/linux/sys linsysfs rw 0 0
tmpfs /compat/linux/dev/shm tmpfs rw,size=8G,noexec,mode=1777 0 0
"Custom project" is too vague for an answer.It's some custom project for Linux (write on C). And I need to run this executable files on the FreeBSD.
What does it do?
"Custom project" is too vague for an answer.
Do you mean that possible to compile it on the centOS and try to run on freeBSD?EDIT I.e. if it compiles & runs on CentOS 7 you can take that same executable and run on FreeBSD. (on the same architecture, e.g. amd64 aka x86_64)
I really don't know very well how this code works. For me, I need compile it and run on freeBSD. I know, this code sends some data to the server.You need to have a good understanding of the code and how it works before you can attempt to port it
That's still too vague to make a proper assessment of the work that may need to be done.I know, this code sends some data to the server.
I'll try to compile it on the centOS and Ubuntu and will give answer tomorrow.Does the code compile and work on CentOS 7? Or does it require something like a recent Ubuntu? If it compiles and runs on CentOS 7 then I would take the route @mjollnir suggested. Just run the Linux
Long story short (answer from Radio Yerevan): Yes, BUT if it needs some exotic library that you can not find in any of the linuxXYZ-c7 ports/packages, then you'll have to use archivers/rpm4 to install them and I strongly suggest to set up a Linux jail inside your FreeBSD host for that. Build your project on a "real" CentOS 7. Do not compile in a standard Linux jail. That would need a special setup. It's possible, though. CentOS 7 in a bhyve(8) VM should be fine.Do you mean that possible to compile it on the centOS and try to run on freeBSD?
Perfectly possible, I do it the other way around to create Linux binaries on my FreeBSD machine. Won't solve the original problem with headers though, you can't just use a Linux system header with a cross-compiler targeting FreeBSD.Build a cross compiling toolchain on Linux so you can build Linux and FreeBSD binaries from the same Linux machine.
You still fail to answer what the actual purpose of the software is.It is just project wich sent some data to the remote server. It uses network IP connection. This is not my code and I just try to run it on freebsd system. I have source code for it and need to compile it for freebsd. In present time it is doesn't matter what project does. It uses some network libraries like in first post of this topic.
This is no hack software. This absolutely legal software. But this software from my work, for commercial project. Sorry, I can't due to NDA tell more about it.You still fail to answer what the actual purpose of the software is.
From the communication so far, I assume that this is some kind of “script kiddie” software used to break into a system.