this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Try to check for broken libstdc++ at runtime (#134)

+40 -17
+24 -15
src/dyld/dyld.cpp
··· 72 72 mgr->setBindAtLaunch(getenv("DYLD_BIND_AT_LAUNCH") != nullptr); 73 73 #endif 74 74 mgr->setIgnoreMissingSymbols(getenv("DYLD_IGN_MISSING_SYMS") != nullptr); 75 + mgr->setIgnoreMissingDependencies(getenv("DYLD_IGN_MISSING_DEPS") != nullptr); 75 76 mgr->setPrintSegments(getenv("DYLD_PRINT_SEGMENTS") != nullptr); 76 77 mgr->setPrintBindings(getenv("DYLD_PRINT_BINDINGS") != nullptr); 77 78 mgr->setPrintRpathExpansion(getenv("DYLD_PRINT_RPATHS") != nullptr); ··· 162 163 163 164 static std::string locateBundleExecutable(std::string bundlePath) 164 165 { 165 - std::regex re(".*/([^\\.]+)\\.app/?$", std::regex::icase); 166 - std::smatch match; 167 - 168 - std::string myBundlePath = "./" + bundlePath; // TODO: fix the regexp to work without this 169 - 170 - if (std::regex_match(myBundlePath, match, re)) 166 + try 171 167 { 172 - std::stringstream ss; 173 - ss << bundlePath; 168 + std::regex re(".*/([^\\.]+)\\.app/?$", std::regex::icase); 169 + std::smatch match; 170 + 171 + std::string myBundlePath = "./" + bundlePath; // TODO: fix the regexp to work without this 172 + 173 + if (std::regex_match(myBundlePath, match, re)) 174 + { 175 + std::stringstream ss; 176 + ss << bundlePath; 174 177 175 - if (bundlePath.back() != '/') 176 - ss << '/'; 178 + if (bundlePath.back() != '/') 179 + ss << '/'; 177 180 178 - ss << "Contents/MacOS/"; 179 - ss << match[1]; 181 + ss << "Contents/MacOS/"; 182 + ss << match[1]; 180 183 181 - return ss.str(); 184 + return ss.str(); 185 + } 186 + else 187 + return bundlePath; 188 + } 189 + catch (const std::regex_error& e) 190 + { 191 + std::cerr << "This version of Darling has been compiled against a broken version of libstdc++\n"; 192 + abort(); 182 193 } 183 - else 184 - return bundlePath; 185 194 } 186 195 187 196 static bool isELF(const char* path)
+16 -2
src/libdyld/DylibSearch.cpp
··· 24 24 #include "MachOObject.h" 25 25 #include "MachOMgr.h" 26 26 #include "VirtualPrefix.h" 27 + #include "DummyObject.h" 27 28 #include <regex.h> 28 29 #include <unistd.h> 29 30 #include <util/stlutils.h> ··· 51 52 52 53 DylibSearch* DylibSearch::instance() 53 54 { 54 - static DylibSearch singleton; 55 - return &singleton; 55 + try 56 + { 57 + static DylibSearch singleton; 58 + return &singleton; 59 + } 60 + catch (const std::regex_error& e) 61 + { 62 + std::cerr << "This version of Darling has been compiled against broken version of libstdc++.\n"; 63 + abort(); 64 + } 56 65 } 57 66 58 67 void DylibSearch::setAdditionalPaths(const std::string& paths) ··· 159 168 return epath; 160 169 } 161 170 } 171 + 172 + /*if (MachOMgr::instance()->ignoreMissingDependencies()) 173 + { 174 + 175 + }*/ 162 176 163 177 return std::string(); 164 178 }