InputFiles(Options& opts, const char** archName);
// implementation from ld::dylib::File::DylibHandler
- virtual ld::dylib::File* findDylib(const char* installPath, const char* fromPath);
+ virtual ld::dylib::File* findDylib(const char* installPath, const ld::dylib::File* fromDylib, bool speculative);
// iterates all atoms in initial files
- void forEachInitialAtom(ld::File::AtomHandler&);
+ void forEachInitialAtom(ld::File::AtomHandler&, ld::Internal& state);
// searches libraries for name
bool searchLibraries(const char* name, bool searchDylibs, bool searchArchives,
bool dataSymbolOnly, ld::File::AtomHandler&) const;
// copy dylibs to link with in command line order
void dylibs(ld::Internal& state);
+ void archives(ld::Internal& state);
+
bool inferredArch() const { return _inferredArch; }
+ void addLinkerOptionLibraries(ld::Internal& state, ld::File::AtomHandler& handler);
+ void createIndirectDylibs();
+
// for -print_statistics
volatile int64_t _totalObjectSize;
volatile int64_t _totalArchiveSize;
ld::File* makeFile(const Options::FileInfo& info, bool indirectDylib);
ld::File* addDylib(ld::dylib::File* f, const Options::FileInfo& info);
void logTraceInfo (const char* format, ...) const;
- void logDylib(ld::File*, bool indirect);
+ void logDylib(ld::File*, bool indirect, bool speculative);
void logArchive(ld::File*) const;
- void createIndirectDylibs();
+ void markExplicitlyLinkedDylibs();
void checkDylibClientRestrictions(ld::dylib::File*);
void createOpaqueFileSections();
-
+ bool libraryAlreadyLoaded(const char* path);
+ bool frameworkAlreadyLoaded(const char* path, const char* frameworkName);
+
// for pipelined linking
- void waitForInputFiles();
+ void waitForInputFiles();
static void waitForInputFiles(InputFiles *inputFiles);
// for threaded input file processing
static void parseWorkerThread(InputFiles *inputFiles);
void startThread(void (*threadFunc)(InputFiles *)) const;
- class CStringEquals {
- public:
- bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); }
- };
- typedef __gnu_cxx::hash_map<const char*, ld::dylib::File*, __gnu_cxx::hash<const char*>, CStringEquals> InstallNameToDylib;
+ typedef std::unordered_map<const char*, ld::dylib::File*, CStringHash, CStringEquals> InstallNameToDylib;
const Options& _options;
std::vector<ld::File*> _inputFiles;
mutable std::set<class ld::File*> _archiveFilesLogged;
+ mutable std::vector<std::string> _archiveFilePaths;
InstallNameToDylib _installPathToDylibs;
std::set<ld::dylib::File*> _allDylibs;
ld::dylib::File* _bundleLoader;
- bool _allDirectDylibsLoaded;
bool _inferredArch;
- int _fileMonitor;
struct strcompclass {
bool operator() (const char *a, const char *b) const { return ::strcmp(a, b) < 0; }
};
int _remainingInputFiles; // number of input files still to parse
ld::File::Ordinal _indirectDylibOrdinal;
+ ld::File::Ordinal _linkerOptionOrdinal;
class LibraryInfo {
ld::File* _lib;
LibraryInfo(ld::dylib::File* dylib) : _lib(dylib), _isDylib(true) {};
LibraryInfo(ld::archive::File* dylib) : _lib(dylib), _isDylib(false) {};
- bool isDylib() { return _isDylib; }
- ld::dylib::File *dylib() { return (ld::dylib::File*)_lib; }
- ld::archive::File *archive() { return (ld::archive::File*)_lib; }
+ bool isDylib() const { return _isDylib; }
+ ld::dylib::File *dylib() const { return (ld::dylib::File*)_lib; }
+ ld::archive::File *archive() const { return (ld::archive::File*)_lib; }
};
std::vector<LibraryInfo> _searchLibraries;
};