return Arch;
}
-static bool runLipo(SmallVectorImpl<const char *> &Args) {
- auto Path = sys::findProgramByName("lipo");
+static bool runLipo(StringRef SDKPath, SmallVectorImpl<const char *> &Args) {
+ auto Path = sys::findProgramByName("lipo", makeArrayRef(SDKPath));
+ if (!Path)
+ Path = sys::findProgramByName("lipo");
if (!Path) {
errs() << "error: lipo: " << Path.getError().message() << "\n";
bool generateUniversalBinary(SmallVectorImpl<ArchAndFilename> &ArchFiles,
StringRef OutputFileName,
- const LinkOptions &Options) {
+ const LinkOptions &Options, StringRef SDKPath) {
// No need to merge one file into a universal fat binary. First, try
// to move it (rename) to the final location. If that fails because
// of cross-device link issues then copy and delete.
outs() << ' ' << ((Arg == nullptr) ? "\n" : Arg);
}
- return Options.NoOutput ? true : runLipo(Args);
+ return Options.NoOutput ? true : runLipo(SDKPath, Args);
}
// Return a MachO::segment_command_64 that holds the same values as