124bool QLibraryPrivate::load_sys() 125{ 126 qDebug()<<__FILE__<<" "<<__LINE__<<"============================================="; 127 QMutexLocker locker(&mutex); 128 QString attempt; 129 QFileSystemEntry fsEntry(fileName); 130 131 QString path = fsEntry.path(); 132 QString name = fsEntry.fileName(); 133 if (path == QLatin1String(".") && !fileName.startsWith(path)) 134 path.clear(); 135 else 136 path += QLatin1Char('/'); 137 138 QStringList suffixes; 139 QStringList prefixes; 140 if (pluginState != IsAPlugin) { 141 prefixes = prefixes_sys(); 142 suffixes = suffixes_sys(fullVersion); 143 } 144 int dlFlags = 0; 145 qDebug()<<__FILE__<<" "<<__LINE__<<"=== dlFlags = "<loadHints(); 147 if (loadHints & QLibrary::ResolveAllSymbolsHint) { 148 dlFlags |= RTLD_NOW; 149 qDebug()<<__FILE__<<" "<<__LINE__<<"=== dlFlags = "<append(QLatin1String(".avx2")); }); 220 } else { 221 // prepend "haswell/" to each prefix in the list 222 transform(prefixes, [](QString *s) { s->prepend(QLatin1String("haswell/")); }); 223 } 224 } 225#endif 226 227 locker.unlock(); 228 bool retry = true; 229 Handle hnd = nullptr; 230 for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) { 231 for (int suffix = 0; retry && !hnd && suffix < suffixes.size(); suffix++) { 232 if (!prefixes.at(prefix).isEmpty() && name.startsWith(prefixes.at(prefix))) 233 continue; 234 if (path.isEmpty() && prefixes.at(prefix).contains(QLatin1Char('/'))) 235 continue; 236 if (!suffixes.at(suffix).isEmpty() && name.endsWith(suffixes.at(suffix))) 237 continue; 238 if (loadHints & QLibrary::LoadArchiveMemberHint) { 239 attempt = name; 240 int lparen = attempt.indexOf(QLatin1Char('(')); 241 if (lparen == -1) 242 lparen = attempt.count(); 243 attempt = path + prefixes.at(prefix) + attempt.insert(lparen, suffixes.at(suffix)); 244 } else { 245 attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix); 246 } 247 248 qDebug()<<__FILE__<<" "<<__LINE__<<"===attempt = "< bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast(utf8Bundle.data()), utf8Bundle.length(), true); 280 QCFType bundle = CFBundleCreate(NULL, bundleUrl); 281 if(bundle) { 282 QCFType url = CFBundleCopyExecutableURL(bundle); 283 char executableFile[FILENAME_MAX]; 284 CFURLGetFileSystemRepresentation(url, true, reinterpret_cast(executableFile), FILENAME_MAX); 285 attempt = QString::fromUtf8(executableFile); 286 hnd = dlopen(QFile::encodeName(attempt), dlFlags); 287 } 288 } 289#endif 290 291 locker.relock(); 292 if (!hnd) { 293 errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); 294 qDebug()<<__FILE__<<" "<<__LINE__<<"===errorString = "<