Skip to content

Commit ce36a96

Browse files
committed
Auto merge of #135763 - nikic:llvm-20, r=cuviper
Update to LLVM 20 LLVM 20 GA is scheduled for March 11th. Rust 1.87 will be stable on May 15th. * [x] #135764 * [x] #136134 * [x] rust-lang/compiler-builtins#752 * [x] llvm/llvm-project#125287 * [x] #136537 * [x] #136895 * [x] Wait for beta branch (Feb 14). Tested: host-x86_64, host-aarch64, apple, mingw, msvc
2 parents 2162e9d + 1873bd3 commit ce36a96

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
[submodule "src/llvm-project"]
3030
path = src/llvm-project
3131
url = https://github.com/rust-lang/llvm-project.git
32-
branch = rustc/19.1-2024-12-03
32+
branch = rustc/20.1-2025-02-13
3333
shallow = true
3434
[submodule "src/doc/embedded-book"]
3535
path = src/doc/embedded-book

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+12-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "llvm/Passes/StandardInstrumentations.h"
2323
#include "llvm/Support/CBindingWrapping.h"
2424
#include "llvm/Support/FileSystem.h"
25+
#include "llvm/Support/Program.h"
2526
#include "llvm/Support/TimeProfiler.h"
2627
#include "llvm/Support/VirtualFileSystem.h"
2728
#include "llvm/Target/TargetMachine.h"
@@ -472,16 +473,19 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
472473
assert(ArgsCstrBuff[ArgsCstrBuffLen - 1] == '\0');
473474
auto Arg0 = std::string(ArgsCstrBuff);
474475
buffer_offset = Arg0.size() + 1;
475-
auto ArgsCppStr = std::string(ArgsCstrBuff + buffer_offset,
476-
ArgsCstrBuffLen - buffer_offset);
477-
auto i = 0;
478-
while (i != std::string::npos) {
479-
i = ArgsCppStr.find('\0', i + 1);
480-
if (i != std::string::npos)
481-
ArgsCppStr.replace(i, 1, " ");
476+
477+
std::string CommandlineArgs;
478+
raw_string_ostream OS(CommandlineArgs);
479+
ListSeparator LS(" ");
480+
for (StringRef Arg : split(StringRef(ArgsCstrBuff + buffer_offset,
481+
ArgsCstrBuffLen - buffer_offset),
482+
'\0')) {
483+
OS << LS;
484+
sys::printArg(OS, Arg, /*Quote=*/true);
482485
}
486+
OS.flush();
483487
Options.MCOptions.Argv0 = Arg0;
484-
Options.MCOptions.CommandlineArgs = ArgsCppStr;
488+
Options.MCOptions.CommandlineArgs = CommandlineArgs;
485489
#else
486490
int buffer_offset = 0;
487491
assert(ArgsCstrBuff[ArgsCstrBuffLen - 1] == '\0');

src/ci/docker/host-x86_64/dist-loongarch64-linux/loongarch64-unknown-linux-gnu.defconfig

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CT_ARCH_LOONGARCH=y
77
# CT_DEMULTILIB is not set
88
CT_ARCH_USE_MMU=y
99
CT_ARCH_ARCH="loongarch64"
10+
CT_TARGET_CFLAGS="-mcmodel=medium"
11+
CT_TARGET_LDFLAGS="-mcmodel=medium"
1012
CT_KERNEL_LINUX=y
1113
CT_LINUX_V_5_19=y
1214
CT_GLIBC_V_2_36=y

src/ci/docker/host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CT_ARCH_LOONGARCH=y
77
# CT_DEMULTILIB is not set
88
CT_ARCH_USE_MMU=y
99
CT_ARCH_ARCH="loongarch64"
10+
CT_TARGET_CFLAGS="-mcmodel=medium"
11+
CT_TARGET_LDFLAGS="-mcmodel=medium"
1012
CT_KERNEL_LINUX=y
1113
CT_LINUX_V_5_19=y
1214
CT_LIBC_MUSL=y

src/llvm-project

0 commit comments

Comments
 (0)