--- v8/src/base/platform/platform-freebsd.cc.orig 2022-02-07 13:39:41 UTC +++ v8/src/base/platform/platform-freebsd.cc @@ -43,14 +43,10 @@ TimezoneCache* OS::CreateTimezoneCache() { return new PosixDefaultTimezoneCache(); } -static unsigned StringToLong(char* buffer) { - return static_cast(strtol(buffer, nullptr, 16)); -} - std::vector OS::GetSharedLibraryAddresses() { std::vector result; int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()}; - size_t miblen = sizeof(mib) / sizeof(mib[0]); + unsigned int miblen = sizeof(mib) / sizeof(mib[0]); size_t buffer_size; if (sysctl(mib, miblen, nullptr, &buffer_size, nullptr, 0) == 0) { // Overallocate the buffer by 1/3 to account for concurrent @@ -82,8 +78,13 @@ std::vector OS::GetSharedLib lib_name = std::string(path); } result.push_back(SharedLibraryAddress( +#if defined(__i386__) || defined(OS_FREEBSD) + lib_name, static_cast(map->kve_start), + static_cast(map->kve_end))); +#else lib_name, reinterpret_cast(map->kve_start), reinterpret_cast(map->kve_end))); +#endif } start += ssize;