Blame chromium-clang_lto_visibility_public.patch

4f31ec8
From 4e380a0e486c080f36adad5b035787d64cfedb3e Mon Sep 17 00:00:00 2001
4f31ec8
From: Stephan Hartmann <stha09@googlemail.com>
4f31ec8
Date: Sat, 27 Jun 2020 13:59:20 +0000
4f31ec8
Subject: [PATCH] GCC: fix mixing __attribute__ with C++ attributes
4f31ec8
4f31ec8
GCC does not support mixing __attribute__ with [[...]] attributes.
4f31ec8
On the other hand [[clang::lto_visibility_public]] isn't supported
4f31ec8
by GCC and only emits a warning. Therefore define Clang specific
4f31ec8
attribute and leave it empty for GCC.
4f31ec8
---
4f31ec8
 base/compiler_specific.h                           | 6 ++++++
4f31ec8
 third_party/blink/renderer/core/frame/frame_view.h | 3 ++-
4f31ec8
 2 files changed, 8 insertions(+), 1 deletion(-)
4f31ec8
4f31ec8
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
4f31ec8
index c8a7649..8fd2252 100644
4f31ec8
--- a/base/compiler_specific.h
4f31ec8
+++ b/base/compiler_specific.h
4f31ec8
@@ -292,4 +292,10 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
4f31ec8
 
4f31ec8
 #endif  // defined(__clang_analyzer__)
4f31ec8
 
4f31ec8
+#if defined(__clang__)
4f31ec8
+#define LTO_VISIBILITY_PUBLIC [[clang::lto_visibility_public]]
4f31ec8
+#else
4f31ec8
+#define LTO_VISIBILITY_PUBLIC
4f31ec8
+#endif
4f31ec8
+
4f31ec8
 #endif  // BASE_COMPILER_SPECIFIC_H_
4f31ec8
diff --git a/third_party/blink/renderer/core/frame/frame_view.h b/third_party/blink/renderer/core/frame/frame_view.h
4f31ec8
index aa5e42a..ec93d89 100644
4f31ec8
--- a/third_party/blink/renderer/core/frame/frame_view.h
4f31ec8
+++ b/third_party/blink/renderer/core/frame/frame_view.h
4f31ec8
@@ -5,6 +5,7 @@
4f31ec8
 #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_
4f31ec8
 #define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_
4f31ec8
 
4f31ec8
+#include "base/compiler_specific.h"
4f31ec8
 #include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
4f31ec8
 #include "third_party/blink/public/platform/viewport_intersection_state.h"
4f31ec8
 #include "third_party/blink/renderer/core/frame/embedded_content_view.h"
4f31ec8
@@ -20,7 +21,7 @@ struct IntrinsicSizingInfo;
4f31ec8
 // clang::lto_visibility_public is necessary to prevent the compiler from
4f31ec8
 // performing a vtable optimization that crashes the renderer. See
4f31ec8
 // crbug.com/1062006.
4f31ec8
-class CORE_EXPORT [[clang::lto_visibility_public]] FrameView
4f31ec8
+class CORE_EXPORT LTO_VISIBILITY_PUBLIC FrameView
4f31ec8
     : public EmbeddedContentView {
4f31ec8
  public:
4f31ec8
   FrameView(const IntRect& frame_rect) : EmbeddedContentView(frame_rect) {}
4f31ec8
-- 
4f31ec8
2.26.2
4f31ec8