Xcode uses Clang/LLVM to compile Objective-C (and used gcc before adopting LLVM). To my knowledge there's nothing closed source involved in the compiler. I had Clang/LLVM compiling Objective-C on Linux a long time ago. Visual Studio for Windows has been able to compile Objective-C for about a year (see https://developer.microsoft.com/en-us/windows/bridges/ios).