[hwasan] fix the build on Linux Ubuntu 14.04. We don't need __hwasan_shadow on Linux...
authorKostya Serebryany <kcc@google.com>
Fri, 31 Aug 2018 02:38:23 +0000 (02:38 +0000)
committerKostya Serebryany <kcc@google.com>
Fri, 31 Aug 2018 02:38:23 +0000 (02:38 +0000)
llvm-svn: 341158

compiler-rt/lib/hwasan/hwasan_dynamic_shadow.cc

index 06682e6..09b2ccf 100644 (file)
@@ -58,6 +58,7 @@ static uptr MapDynamicShadow(uptr shadow_size_bytes) {
 
 }  // namespace __hwasan
 
+#if SANITIZER_ANDROID
 extern "C" {
 
 INTERFACE_ATTRIBUTE void __hwasan_shadow();
@@ -124,3 +125,13 @@ uptr FindDynamicShadowStart(uptr shadow_size_bytes) {
 }
 
 }  // namespace __hwasan
+#else
+namespace __hwasan {
+
+uptr FindDynamicShadowStart(uptr shadow_size_bytes) {
+  return MapDynamicShadow(shadow_size_bytes);
+}
+
+}  // namespace __hwasan
+#
+#endif  // SANITIZER_ANDROID