wrapper: Get rid of __builtin_readcyclecounter()

Crashes on some ARM machines
This commit is contained in:
Thomas Pöchtrager 2020-03-04 18:21:28 +01:00
parent bee9df60f1
commit 952985fee3

View File

@ -31,11 +31,7 @@ int sw_vers(int argc, char **argv, Target &target) {
auto genFakeBuildVer = [](std::string & build)->std::string & { auto genFakeBuildVer = [](std::string & build)->std::string & {
std::stringstream tmp; std::stringstream tmp;
#if __has_builtin(__builtin_readcyclecounter)
srand(static_cast<unsigned int>(__builtin_readcyclecounter()));
#else
srand(static_cast<unsigned int>(getNanoSeconds())); srand(static_cast<unsigned int>(getNanoSeconds()));
#endif
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
tmp << std::hex << (rand() % 16 + 1); tmp << std::hex << (rand() % 16 + 1);