Skip to content

Commit 2929254

Browse files
authored
Update LLVM version, fix breaks (#4886)
- The actual reason I started this: minor lowering updates in the golden LLVM IR - Process.inc changed enough to need a patch context update. - llvm/llvm-project#123126 added `proto_library` uses without a `load`, which is broken in bazel 8 - Just commenting these out because we don't use them. I'll follow up separately about a possible fix, but continuing to use `WORKSPACE` is a bigger issue LLVM probably should address. - Note this update is also triggering removal of `migrate_cpp`, in #4887
1 parent 621d2d2 commit 2929254

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+144
-74
lines changed

MODULE.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ bazel_dep(name = "zstd", version = "1.5.6", repo_name = "llvm_zstd")
116116

117117
# We pin to specific upstream commits and try to track top-of-tree reasonably
118118
# closely rather than pinning to a specific release.
119-
# HEAD as of 2025-01-15.
120-
llvm_project_version = "6ca560a9092e29c9f9817db6d6da09edd5f0ded7"
119+
# HEAD as of 2025-02-03.
120+
llvm_project_version = "6dfe20dbbd65e2945350ed9a93eb383131c49511"
121121

122122
# Load a repository for the raw llvm-project, pre-overlay.
123123
http_archive(
@@ -127,8 +127,9 @@ http_archive(
127127
patches = [
128128
"@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",
129129
"@carbon//bazel/llvm_project:0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch",
130+
"@carbon//bazel/llvm_project:0003_Comment_out_unloaded_proto_library_dependencies.patch",
130131
],
131-
sha256 = "1ee1e9baa236ac35c43b1a0878629f82b8ca0b85effe83aa697736a0b515923d",
132+
sha256 = "dde3c121ca80e9dfe06c6edf46733f559f90014919e2d30a47541267a6875af7",
132133
strip_prefix = "llvm-project-{0}".format(llvm_project_version),
133134
urls = ["https://github.com/llvm/llvm-project/archive/{0}.tar.gz".format(llvm_project_version)],
134135
)

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/llvm_project/0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ glibc installs.
1111
1 file changed, 7 insertions(+)
1212

1313
diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc
14-
index d3d9fb7d7187..da3e721146f6 100644
14+
index 550b0de2e045..6d449489c450 100644
1515
--- a/llvm/lib/Support/Unix/Process.inc
1616
+++ b/llvm/lib/Support/Unix/Process.inc
17-
@@ -31,6 +31,13 @@
18-
#if HAVE_SIGNAL_H
17+
@@ -22,6 +22,13 @@
18+
#include <sys/resource.h>
19+
#include <sys/stat.h>
1920
#include <signal.h>
20-
#endif
2121
+// When glibc is in use, detect mallinfo2 to address mallinfo deprecation
2222
+// warnings.
2323
+#if !defined(HAVE_MALLINFO2) && defined(__GLIBC_PREREQ)
@@ -29,4 +29,4 @@ index d3d9fb7d7187..da3e721146f6 100644
2929
#include <malloc.h>
3030
#endif
3131
--
32-
2.36.1
32+
2.48.1
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 01f35f954121def682097d8e697ac524b2c8acc6 Mon Sep 17 00:00:00 2001
2+
From: jonmeow <[email protected]>
3+
Date: Mon, 3 Feb 2025 11:18:25 -0800
4+
Subject: [PATCH] Comment out unloaded proto_library dependencies
5+
6+
---
7+
.../llvm-project-overlay/clang/BUILD.bazel | 46 +++++++++----------
8+
1 file changed, 23 insertions(+), 23 deletions(-)
9+
10+
diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
11+
index e3b20e43dd22..8b26e322a0ed 100644
12+
--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
13+
+++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
14+
@@ -2603,29 +2603,29 @@ cc_library(
15+
],
16+
)
17+
18+
-proto_library(
19+
- name = "cxx-proto",
20+
- srcs = ["tools/clang-fuzzer/cxx_proto.proto"],
21+
-)
22+
-
23+
-cc_proto_library(
24+
- name = "cxx_cc_proto",
25+
- deps = [":cxx-proto"],
26+
-)
27+
-
28+
-cc_library(
29+
- name = "proto-to-cxx-lib",
30+
- srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp"],
31+
- hdrs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.h"],
32+
- includes = ["tools/clang-fuzzer"],
33+
- deps = [":cxx_cc_proto"],
34+
-)
35+
-
36+
-cc_binary(
37+
- name = "clang-proto-to-cxx",
38+
- srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx_main.cpp"],
39+
- deps = [":proto-to-cxx-lib"],
40+
-)
41+
+# proto_library(
42+
+# name = "cxx-proto",
43+
+# srcs = ["tools/clang-fuzzer/cxx_proto.proto"],
44+
+# )
45+
+#
46+
+# cc_proto_library(
47+
+# name = "cxx_cc_proto",
48+
+# deps = [":cxx-proto"],
49+
+# )
50+
+#
51+
+# cc_library(
52+
+# name = "proto-to-cxx-lib",
53+
+# srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp"],
54+
+# hdrs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.h"],
55+
+# includes = ["tools/clang-fuzzer"],
56+
+# deps = [":cxx_cc_proto"],
57+
+# )
58+
+#
59+
+# cc_binary(
60+
+# name = "clang-proto-to-cxx",
61+
+# srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx_main.cpp"],
62+
+# deps = [":proto-to-cxx-lib"],
63+
+# )
64+
65+
cc_library(
66+
name = "clang-fuzzer-initialize",
67+
--
68+
2.48.1
69+

toolchain/lower/testdata/alias/local.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn F() -> i32 {
2727
// CHECK:STDOUT: }
2828
// CHECK:STDOUT:
2929
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
30-
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
30+
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #0
3131
// CHECK:STDOUT:
3232
// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
3333
// CHECK:STDOUT:

toolchain/lower/testdata/array/array_in_place.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn G() {
3131
// CHECK:STDOUT: }
3232
// CHECK:STDOUT:
3333
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
34-
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
34+
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #0
3535
// CHECK:STDOUT:
3636
// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
3737
// CHECK:STDOUT:

toolchain/lower/testdata/array/assign_return_value.carbon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ fn Run() {
4545
// CHECK:STDOUT: }
4646
// CHECK:STDOUT:
4747
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
48-
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0
48+
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0
4949
// CHECK:STDOUT:
5050
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
51-
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
51+
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #1
5252
// CHECK:STDOUT:
5353
// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
5454
// CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }

toolchain/lower/testdata/array/base.carbon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ fn Run() {
6767
// CHECK:STDOUT: }
6868
// CHECK:STDOUT:
6969
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
70-
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
70+
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #0
7171
// CHECK:STDOUT:
7272
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
73-
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1
73+
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1
7474
// CHECK:STDOUT:
7575
// CHECK:STDOUT: ; uselistorder directives
7676
// CHECK:STDOUT: uselistorder i32 1, { 0, 2, 1, 3, 4, 5, 6, 7 }

toolchain/lower/testdata/array/field.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class A {
5959
// CHECK:STDOUT: }
6060
// CHECK:STDOUT:
6161
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
62-
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0
62+
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0
6363
// CHECK:STDOUT:
6464
// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
6565
// CHECK:STDOUT:

toolchain/lower/testdata/array/function_param.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn G() -> i32 {
4040
// CHECK:STDOUT: }
4141
// CHECK:STDOUT:
4242
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
43-
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0
43+
// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #0
4444
// CHECK:STDOUT:
4545
// CHECK:STDOUT: attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
4646
// CHECK:STDOUT:

0 commit comments

Comments
 (0)