tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.8k stars 318 forks source link

Add FAQ #405

Open iTrooz opened 7 months ago

iTrooz commented 7 months ago

Here are some questions I had to figure out when trying to use osxcross:

Q: I get the error "X symbol is not available" when compiling, X being a symbol related to MacOS A: This most probably mean you are using an older MacOS SDK version, which do not contain that symbol yet. Try to use a greater version of the MacOS SDK

Q: Doesn't upgrading the SDK mean I won't support older MacOS versions ? A: No, the compatibility between a binary and a MacOS release is controlled by the deployment target (minimum MacOS version it will be able to run on)

I have no idea if what I'm saying is true, please verify before adding them

I think it would be a good idea to add a FAQ to the README The two questions I stated above could be a start, and we could add common questions from newcomers as time goes on.

HinTak commented 7 months ago

Both of your answers are wrong. 1. There are a lot if reasons why symbols are missing, other than wrong version of SDK. 2. Libraries have inter-dependencies, and also, many of them refer to each other at their on-disk locations. Copying and relocating them are not trivial, and often requires understanding and modifying binaries.

That said, yours are NOT osxcross FAQs: they are general compiler, linker and runtime linker knowledge, which cannot fit in a FAQ.

You should read more about compiler/ linker/runtime linker before you ask or file these sort of thing. Stackoverflow is a good place for random tech knowledge; the authoritative place for compiler related knowledge, is of course https://gcc.gnu.org and https://llvm.org . Just read the GCC FAQ and LLVM/Clang FAQ would be a good start.

Either way, I am not going to respond further.

iTrooz commented 7 months ago

Hey !

There are a lot if reasons why symbols are missing, other than wrong version of SDK

Sorry, I should have clarified: I meant when a symbol from the SDK is missing, I will edit the question to reflect that. For example, at some point the symbol ___isOSVersionAtLeast was missing, and it was because (IIRC, I don't remember exactly) I was using SDK version 12.1, and the symbol was introduced in a newer SDK version. Switching to SDK version 14.2 fixed the problem. Looking at the error "symbol X is missing", this might not be trivial to know. But, people may be reluctant to upgrade the SDK, which is why I added a second FAQ entry

Libraries have inter-dependencies, and also, many of them refer to each other at their on-disk locations. Copying and relocating them are not trivial, and often requires understanding and modifying binaries.

Oh, okay. Honestly, I don't have time to verify what lead me to think that, so I'll trust you. This whole "MacOS cross-compilation" thing has been really difficult to understand for me

iTrooz commented 7 months ago

I updated the entries in my original message, hopefully they are more true now