I should confess I do not even own a Mac, I have done Windows and Linux programming. Here I hope to learn something about Mac OS X by relating it to Linux if possible. And hopefully to be able to compile a Mac shared library without purchasing a Mac.
Note: There is absolutely no GUI, so Cocoa should not be required right? Also imagine I use C or c++0x, and POSIX for now.
What are the differences between Mac OS X shared library and Linux?
What is required to be able to run Linux .so files on Mac? Do I need a Mac-native replacement for ld-linux.so, and linux-gate.so or some other crt related object files?
Is there any cross platform gcc for Mac on Windows or Linux? (again no GUI)
Even though you don’t need Cocoa/Objective-C, you still need to link against Mac OS X libraries (like
libSystem, which is likelibcon Linux). The file format is totally different (ELF vs. Mach-O) so there is no way to make a Linux library or tool work on a Mac without recompilation.If you stick to POSIX/SUS APIs you can easily write things so they compile on both Linux and Mac without changes as long as you don’t try any platform-specific things like reading Linux
/procfiles.There doesn’t seem to exist any cross-compiler for Linux-to-Mac development and I can’t imagine anyone trying to do this: you’d be chasing a moving target without any real benefit.
The solution as always with these type of questions: buy a used MacMini on eBay or similar auction platform. They’re cheap and will suffice.