macvim: Clean up hybrid compilation environment
MacVim compiles the Vim part using `/usr/bin/clang` and the GUI part using Xcode. The Xcode portion always uses Xcode's own SDK and we have no workable alternative. The Vim portion so far has been compiling using a hybrid compilation environment, where it uses the SDK for most stuff but picks up a bunch of library linker paths (including libSystem) by virtue of Ruby's LDFLAGS. This hybrid compilation environment meant that if the SDK headers referenced a symbol that the library itself didn't have, this could produce link errors. Previously we attempted to fix this by synthesizing an include path that contained just the one header from Nix's Libsystem that referenced the missing symbol, to get rid of the reference and allow linking to work again, but this was very hacky and runs the risk of future Xcode SDK changes producing the same errors with different headers, or of future SDK versions expecting the intercepted header to contain a definition that Nix's doesn't. This new approach is to just clean up the compilation environment such that the Vim portion is compiling against the Xcode SDK as well, by sanitizing the LDFLAGS produced by the configure script so it stops referencing Nix's versions of OS libraries. This means the resulting Vim binary no longer depends at runtime on Nix for anything except the scripting language support, but that's how it's been for the MacVim binary all along anyway, and this approach should keep us insulated against future Xcode SDK changes.
parent
e4311a77
Please register or sign in to comment