File chromium-clang-nomerge.patch of Package chromium-ffmpeg-extra (Revision acf13cd4d3b182c723d1231bb1ce7ca6)

Currently displaying revision acf13cd4d3b182c723d1231bb1ce7ca6 , Show latest

44
 
1
Upstream-status: Inapproriate
2
3
Upstream suggests to use Chromium's hermetic clang
4
instead.
5
6
Signed-off-by: Maksim Sisov <msisov@igalia.com>
7
---
8
From bde3186ccba169391fb428fcc296b2236ada0010 Mon Sep 17 00:00:00 2001
9
From: Maksim Sisov <msisov@igalia.com>
10
Date: Wed, 5 May 2021 15:20:43 +0300
11
Subject: [PATCH] nomerge attribute on declaration is only available since
12
 clang 12
13
14
This change fixes builds with older clangs that do not allow
15
nomerge attributes on declaration. Otherwise, the following error
16
is produced -
17
18
build error: 'nomerge' attribute cannot be applied to a declaration
19
20
See https://reviews.llvm.org/D92800
21
22
Change-Id: I32e1f7dc9049737d54d8a16de5308aa5aae1ced1
23
---
24
 base/compiler_specific.h | 3 ++-
25
 1 file changed, 2 insertions(+), 1 deletion(-)
26
27
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
28
index 6693e9ea33e9..d3b425abe9ca 100644
29
--- a/base/compiler_specific.h
30
+++ b/base/compiler_specific.h
31
@@ -340,7 +340,8 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
32
 #endif  // defined(__clang_analyzer__)
33
 
34
 // Use nomerge attribute to disable optimization of merging multiple same calls.
35
-#if defined(__clang__) && HAS_ATTRIBUTE(nomerge)
36
+#if defined(__clang__) && (__clang_major__ >= 12) && \
37
+    HAS_ATTRIBUTE(nomerge) && !defined(OS_CHROMEOS)
38
 #define NOMERGE [[clang::nomerge]]
39
 #else
40
 #define NOMERGE
41
-- 
42
2.25.1
43
44