From a333e2602203cfce35fb9a08af05e3eacefebfc9 Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Mon, 12 Feb 2024 20:27:43 -0500 Subject: [PATCH 1/2] RustWrapper: adapt for llvm/llvm-project@a38152e2156 I am only partially confident this is reasonable, and the argument is ignored on targets other than ARM64EC which appears to be some Windows 11 thing, and therefore I have no way to test. @rustbot label: +llvm-main --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index a2dfebec59441..a3f8d09ff2465 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1813,6 +1813,11 @@ extern "C" LLVMRustResult LLVMRustWriteImportLibrary( ImportName, Path, ConvertedExports, + #if LLVM_VERSION_GE(19, 0) + // FIXME: on everything but ARM64EC this argument is ignored. On that + // platform passing this value _may_ be incorrect. + ConvertedExports, + #endif static_cast(Machine), MinGW); if (Error) { From 09a159601c52a9619b4bb948b578123aa4ebf5ef Mon Sep 17 00:00:00 2001 From: Augie Fackler Date: Tue, 13 Feb 2024 09:08:38 -0500 Subject: [PATCH 2/2] LLVMRustWriteImportLibrary: use nullopt for NativeExports argument Per comments in llvm/llvm-project#81600. --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index a3f8d09ff2465..ea5f8eaba6e9e 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1814,9 +1814,7 @@ extern "C" LLVMRustResult LLVMRustWriteImportLibrary( Path, ConvertedExports, #if LLVM_VERSION_GE(19, 0) - // FIXME: on everything but ARM64EC this argument is ignored. On that - // platform passing this value _may_ be incorrect. - ConvertedExports, + std::nullopt, #endif static_cast(Machine), MinGW);