Skip to content

Commit 4224526

Browse files
CBL-Mariner-BotPawelWMSmfrw
authored
[AUTO-CHERRYPICK] Updated clang, compiler-rt, libcxx, lld, lldb, and llvm to version 18.1.8. - branch 3.0-dev (#13958)
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com> Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
1 parent 56d3aa8 commit 4224526

17 files changed

Lines changed: 166 additions & 322 deletions

SPECS/clang/clang-format-fix.patch

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
From 85df28180bd38d3fd5356efe6022eebec31e0814 Mon Sep 17 00:00:00 2001
2+
From: Owen Pan <owenpiano@gmail.com>
3+
Date: Fri, 18 Oct 2024 21:10:00 -0700
4+
Subject: [PATCH] [clang-format] Fix a bug that always returns error for JSON
5+
(#112839)
6+
7+
Fixes #108556.
8+
9+
---
10+
clang/test/Format/dry-run-warning.cpp | 22 ++++++++++++++++++++++
11+
clang/tools/clang-format/ClangFormat.cpp | 18 +++++++++---------
12+
2 files changed, 31 insertions(+), 9 deletions(-)
13+
create mode 100644 clang/test/Format/dry-run-warning.cpp
14+
15+
diff --git a/clang/test/Format/dry-run-warning.cpp b/clang/test/Format/dry-run-warning.cpp
16+
new file mode 100644
17+
index 000000000..4b85de40b
18+
--- /dev/null
19+
+++ b/clang/test/Format/dry-run-warning.cpp
20+
@@ -0,0 +1,22 @@
21+
+// RUN: echo '{' > %t.json
22+
+// RUN: echo ' "married": true' >> %t.json
23+
+// RUN: echo '}' >> %t.json
24+
+
25+
+// RUN: clang-format -n -style=LLVM %t.json 2>&1 | FileCheck %s -allow-empty
26+
+
27+
+// RUN: clang-format -n -style=LLVM < %t.json 2>&1 \
28+
+// RUN: | FileCheck %s -check-prefix=CHECK2 -strict-whitespace
29+
+
30+
+// RUN: echo '{' > %t.json
31+
+// RUN: echo ' "married" : true' >> %t.json
32+
+// RUN: echo '}' >> %t.json
33+
+
34+
+// RUN: clang-format -n -style=LLVM < %t.json 2>&1 | FileCheck %s -allow-empty
35+
+
36+
+// RUN: clang-format -n -style=LLVM %t.json 2>&1 \
37+
+// RUN: | FileCheck %s -check-prefix=CHECK2 -strict-whitespace
38+
+
39+
+// RUN: rm %t.json
40+
+
41+
+// CHECK-NOT: warning
42+
+// CHECK2: warning: code should be clang-formatted
43+
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
44+
index e122cea50..d40d8f5d1 100644
45+
--- a/clang/tools/clang-format/ClangFormat.cpp
46+
+++ b/clang/tools/clang-format/ClangFormat.cpp
47+
@@ -341,9 +341,6 @@ static void outputReplacementsXML(const Replacements &Replaces) {
48+
static bool
49+
emitReplacementWarnings(const Replacements &Replaces, StringRef AssumedFileName,
50+
const std::unique_ptr<llvm::MemoryBuffer> &Code) {
51+
- if (Replaces.empty())
52+
- return false;
53+
-
54+
unsigned Errors = 0;
55+
if (WarnFormat && !NoWarnFormat) {
56+
llvm::SourceMgr Mgr;
57+
@@ -479,9 +476,11 @@ static bool format(StringRef FileName) {
58+
Replacements Replaces = sortIncludes(*FormatStyle, Code->getBuffer(), Ranges,
59+
AssumedFileName, &CursorPosition);
60+
61+
+ const bool IsJson = FormatStyle->isJson();
62+
+
63+
// To format JSON insert a variable to trick the code into thinking its
64+
// JavaScript.
65+
- if (FormatStyle->isJson() && !FormatStyle->DisableFormat) {
66+
+ if (IsJson && !FormatStyle->DisableFormat) {
67+
auto Err = Replaces.add(tooling::Replacement(
68+
tooling::Replacement(AssumedFileName, 0, 0, "x = ")));
69+
if (Err)
70+
@@ -499,11 +498,12 @@ static bool format(StringRef FileName) {
71+
Replacements FormatChanges =
72+
reformat(*FormatStyle, *ChangedCode, Ranges, AssumedFileName, &Status);
73+
Replaces = Replaces.merge(FormatChanges);
74+
- if (OutputXML || DryRun) {
75+
- if (DryRun)
76+
- return emitReplacementWarnings(Replaces, AssumedFileName, Code);
77+
- else
78+
- outputXML(Replaces, FormatChanges, Status, Cursor, CursorPosition);
79+
+ if (DryRun) {
80+
+ return Replaces.size() > (IsJson ? 1 : 0) &&
81+
+ emitReplacementWarnings(Replaces, AssumedFileName, Code);
82+
+ }
83+
+ if (OutputXML) {
84+
+ outputXML(Replaces, FormatChanges, Status, Cursor, CursorPosition);
85+
} else {
86+
IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
87+
new llvm::vfs::InMemoryFileSystem);
88+
--
89+
2.34.1
90+

SPECS/clang/clang.signatures.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"llvmorg-18.1.2.tar.gz": "8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b"
3+
"llvmorg-18.1.8.tar.gz": "09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856"
44
}
55
}

SPECS/clang/clang.spec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44

55
Summary: C, C++, Objective C and Objective C++ front-end for the LLVM compiler.
66
Name: clang
7-
Version: 18.1.2
8-
Release: 4%{?dist}
7+
Version: 18.1.8
8+
Release: 1%{?dist}
99
License: NCSA
1010
Vendor: Microsoft Corporation
1111
Distribution: Azure Linux
1212
Group: Development/Tools
1313
URL: https://clang.llvm.org
1414
Source0: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-%{version}.tar.gz
1515
Patch1: CVE-2024-7883.patch
16+
Patch2: clang-format-fix.patch
1617
BuildRequires: cmake
1718
BuildRequires: libxml2-devel
1819
BuildRequires: llvm-devel = %{version}
@@ -245,6 +246,9 @@ make clang-check
245246
%{_includedir}/clang-tidy/
246247

247248
%changelog
249+
* Tue Jun 03 2025 Pawel Winogrodzki <pawelwi@microsoft.com> - 18.1.8-1
250+
- Updated to version 18.1.8.
251+
248252
* Thu Apr 10 2025 Jyoti Kanase <v-jykanase@microsoft.com> - 18.1.2-4
249253
- Fix CVE-2024-7883
250254

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"llvmorg-18.1.2.tar.gz": "8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b"
3+
"llvmorg-18.1.8.tar.gz": "09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856"
44
}
55
}

SPECS/compiler-rt/compiler-rt.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
Summary: LLVM compiler support routines
66
Name: compiler-rt
7-
Version: 18.1.2
8-
Release: 3%{?dist}
7+
Version: 18.1.8
8+
Release: 1%{?dist}
99
License: Apache 2.0 WITH exceptions
1010
Vendor: Microsoft Corporation
1111
Distribution: Azure Linux
@@ -50,6 +50,9 @@ cd build
5050
%{_libdir}/clang/%{maj_ver}/share/*
5151

5252
%changelog
53+
* Tue Jun 03 2025 Pawel Winogrodzki <pawelwi@microsoft.com> - 18.1.8-1
54+
- Updated to version 18.1.8.
55+
5356
* Thu Jul 25 2024 Andrew Phelps <anphel@microsoft.com> - 18.1.2-3
5457
- Fix installation path
5558

SPECS/erlang/erlang.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: erlang
33
Name: erlang
44
Version: 26.2.5.12
5-
Release: 1%{?dist}
5+
Release: 2%{?dist}
66
License: Apache-2.0
77
Vendor: Microsoft Corporation
88
Distribution: Azure Linux
@@ -34,7 +34,7 @@ export ERL_TOP=`pwd`
3434

3535
%check
3636
export ERL_TOP=`pwd`
37-
./otp_build check --no-docs
37+
./otp_build check --no-docs --no-format-check
3838

3939
%post
4040

@@ -53,6 +53,9 @@ export ERL_TOP=`pwd`
5353
%{_libdir}/erlang/*
5454

5555
%changelog
56+
* Wed Jun 04 2025 Muhammad Falak <mwani@microsoft.com> - 26.2.5.11-2
57+
- Skip format-check in tests
58+
5659
* Wed May 14 2025 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 26.2.5.12-1
5760
- Auto-upgrade to 26.2.5.12 - for CVE-2025-46712
5861

SPECS/libcxx/CVE-2024-31852.patch

Lines changed: 0 additions & 153 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"llvmorg-18.1.2.tar.gz": "8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b"
3+
"llvmorg-18.1.8.tar.gz": "09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856"
44
}
55
}

SPECS/libcxx/libcxx.spec

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@
88

99
Summary: C++ standard library targeting C++11
1010
Name: libcxx
11-
Version: %{maj_ver}.1.2
12-
Release: 3%{?dist}
11+
Version: %{maj_ver}.1.8
12+
Release: 1%{?dist}
1313
License: Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
1414
Vendor: Microsoft Corporation
1515
Distribution: Azure Linux
1616
Group: Development/Tools
1717
URL: http://libcxx.llvm.org/
1818
Source0: https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-%{version}.tar.gz
19-
Patch0: CVE-2024-31852.patch
2019

2120
BuildRequires: clang
2221
BuildRequires: cmake
@@ -180,6 +179,10 @@ popd
180179
%{_libdir}/libunwind.a
181180

182181
%changelog
182+
* Tue Jun 03 2025 Pawel Winogrodzki <pawelwi@microsoft.com> - 18.1.8-1
183+
- Updated to version 18.1.8.
184+
- Removed the patch for CVE-2024-31852 - already fixed in 18.1.3.
185+
183186
* Wed Oct 03 2024 Henry Li <lihl@microsoft.com> - 18.1.2-3
184187
- Add patch to resolve CVE-2024-31852
185188

SPECS/lld/lld.signatures.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"llvmorg-18.1.2.tar.gz": "8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b"
3+
"llvmorg-18.1.8.tar.gz": "09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856"
44
}
55
}

0 commit comments

Comments
 (0)