+ Out2 << "#!/bin/sh\nlli \\\n";
+ // gcc accepts -l<lib> and implicitly searches /lib and /usr/lib.
+ LibPaths.push_back("/lib");
+ LibPaths.push_back("/usr/lib");
+ // We don't need to link in libc! In fact, /usr/lib/libc.so may not be a
+ // shared object at all! See RH 8: plain text.
+ std::vector<std::string>::iterator libc =
+ std::find(Libraries.begin(), Libraries.end(), "c");
+ if (libc != Libraries.end()) Libraries.erase(libc);
+ // List all the shared object (native) libraries this executable will need
+ // on the command line, so that we don't have to do this manually!
+ for (std::vector<std::string>::iterator i = Libraries.begin(),
+ e = Libraries.end(); i != e; ++i) {
+ std::string FullLibraryPath = FindLib(*i, LibPaths, true);
+ if (!FullLibraryPath.empty())
+ Out2 << " -load=" << FullLibraryPath << " \\\n";
+ }
+ Out2 << " $0.bc $*\n";