Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbf26afe authored by Andre Braga's avatar Andre Braga
Browse files

libchrome: Fix build when using clang older than v12

Versions of clang older than v12 do not support the nomerge statement
attribute. This change fixes builds using clang older than v12.

Bug: 241842750
Tag: #floss
Test: Manual - Run "./build.py" for all supported platforms and assure build passes.

Change-Id: Ic48b34ea35ab7574138010caaf801323e914fdc4
parent 7bb4b030
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
From 3841f20ab4c505dacc3bafb5348af79abe211849 Mon Sep 17 00:00:00 2001
From: Andre Braga <andrebraga@google.com>
Date: Mon, 8 Aug 2022 21:13:05 +0000
Subject: [PATCH] Fix build issues when using clang older than v12

---
 base/compiler_specific.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libchrome/base/compiler_specific.h b/libchrome/base/compiler_specific.h
index 8660018dc7..ad0e72eb84 100644
--- a/libchrome//base/compiler_specific.h
+++ b/libchrome//base/compiler_specific.h
@@ -370,7 +370,7 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) {
 #endif  // defined(__clang_analyzer__)
 
 // Use nomerge attribute to disable optimization of merging multiple same calls.
-#if defined(__clang__) && __has_attribute(nomerge)
+#if defined(__clang__) && __has_attribute(nomerge) && (__clang_major__ >= 12)
 #define NOMERGE [[clang::nomerge]]
 #else
 #define NOMERGE
-- 
2.37.1.559.g78731f0fdb-goog
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@
0001-rebase_path-for-write_args.patch
0001-Remove-absl-from-pkgconfig.patch
0001-Fix-build-issues-on-930012.patch
0001-Fix-build-issues-when-using-clang-older-than-v12.patch
 No newline at end of file