From: Orvid King Date: Wed, 12 Aug 2015 20:12:46 +0000 (-0700) Subject: Disable VDSO on MSVC X-Git-Tag: v0.54.0~15 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=abb1acc6ba94cac1f50377e925135afcc718d0ed;p=folly.git Disable VDSO on MSVC Summary: MSVC will never be able to load VDSO, and doesn't even have dlopen, so just return `nullptr`, and let the fallback mechanisms handle it from there. Closes #282 Reviewed By: @yfeldblum Differential Revision: D2307461 Pulled By: @sgolemon --- diff --git a/folly/detail/CacheLocality.cpp b/folly/detail/CacheLocality.cpp index 26cb1265..87f85928 100644 --- a/folly/detail/CacheLocality.cpp +++ b/folly/detail/CacheLocality.cpp @@ -16,8 +16,10 @@ #include +#ifndef _MSC_VER #define _GNU_SOURCE 1 // for RTLD_NOLOAD #include +#endif #include #include @@ -204,6 +206,9 @@ CacheLocality CacheLocality::uniform(size_t numCpus) { /// Resolves the dynamically loaded symbol __vdso_getcpu, returning null /// on failure static Getcpu::Func loadVdsoGetcpu() { +#ifdef _MSC_VER + return nullptr; +#else void* h = dlopen("linux-vdso.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); if (h == nullptr) { return nullptr; @@ -219,6 +224,7 @@ static Getcpu::Func loadVdsoGetcpu() { } return func; +#endif } Getcpu::Func Getcpu::vdsoFunc() {