-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bootstrap: "download-ci-llvm = true" doesn't work on x86_64-pc-windows-gnu with lld #107668
Comments
It happens only with LLD but i haven't investigated. |
cc #39915 do either of you know what LLD is doing differently compared to LD? is this something rustc controls? It would help to have a minimization smaller than "all of rustc and llvm" ... |
I don't know the answer to any of those questions but this issue stopped happening at MSYS2 so it could have been some LLVM 16 change (MSYS2 uses LLVM 15 but backports important patches from LLVM 16) that fixed this problem there. |
Looks like we're currently using LLVM 15: https://github.com/rust-lang/llvm-project/tree/rustc/15.0-2022-12-07 @rustbot label +S-blocked |
Yup, I plan to try once #107224 is merged. |
This is still an issue with LLVM 17.0.5. |
There's an ODR violation in M68k's So it's not a linker's problem, The simplest fix is to rename the structure (instead of adding virtual methods). diff --git a/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp b/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp
index b0ada29d1cea..93b250656cd2 100644
--- a/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp
+++ b/llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp
@@ -118,7 +118,7 @@ bool M68kCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
CCAssignFn *AssignFn =
TLI.getCCAssignFn(F.getCallingConv(), false, F.isVarArg());
IncomingValueAssigner ArgAssigner(AssignFn);
- FormalArgHandler ArgHandler(MIRBuilder, MRI);
+ M68kFormalArgHandler ArgHandler(MIRBuilder, MRI);
return determineAndHandleAssignments(ArgHandler, ArgAssigner, SplitArgs,
MIRBuilder, F.getCallingConv(),
F.isVarArg());
diff --git a/llvm/lib/Target/M68k/GISel/M68kCallLowering.h b/llvm/lib/Target/M68k/GISel/M68kCallLowering.h
index a1589e96aa3d..5e05e46f4ac4 100644
--- a/llvm/lib/Target/M68k/GISel/M68kCallLowering.h
+++ b/llvm/lib/Target/M68k/GISel/M68kCallLowering.h
@@ -63,8 +63,8 @@ private:
ISD::ArgFlagsTy Flags) override;
};
-struct FormalArgHandler : public M68kIncomingValueHandler {
- FormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
+struct M68kFormalArgHandler : public M68kIncomingValueHandler {
+ M68kFormalArgHandler(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
: M68kIncomingValueHandler(MIRBuilder, MRI) {}
}; I wish I tried to debug this a few years eariler. |
Could someone submit this to LLVM? |
You can simply open pull request to https://github.com/llvm/llvm-project/ |
Opened a pull request with the fix - llvm/llvm-project#72797 |
It prevents LLVM from being linked with LLD at least on Windows, with errors like this: ``` = note: ld.lld: error: duplicate symbol: vtable for llvm::FormalArgHandler >>> defined at librustc_llvm-a81737dd65a7c126.rlib(M68kCallLowering.cpp.obj) >>> defined at librustc_llvm-a81737dd65a7c126.rlib(PPCCallLowering.cpp.obj) ``` Binutils linker also complains about this, but only with warnings. `FormalArgHandler` has a base class `M68kIncomingValueHandler` which doesn't have a virtual method `markPhysRegUsed` like `IncomingValueHandler`s for all other targets including PPC, so it results in a conflict. The simplest fix is to rename the `FormalArgHandler` structure (rather than to add virtual methods for compatibility). cc rust-lang/rust#107668
Fixed in #119159. |
Update LLVM submodule to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159. Fixes rust-lang#107668
Rollup merge of rust-lang#119159 - petrochenkov:llvmup, r=nikic Update LLVM submodule to pick up "[M68k] Fix ODR violation in GISel code (rust-lang#72797)" rust-lang/llvm-project#159. Fixes rust-lang#107668
It prevents LLVM from being linked with LLD at least on Windows, with errors like this: ``` = note: ld.lld: error: duplicate symbol: vtable for llvm::FormalArgHandler >>> defined at librustc_llvm-a81737dd65a7c126.rlib(M68kCallLowering.cpp.obj) >>> defined at librustc_llvm-a81737dd65a7c126.rlib(PPCCallLowering.cpp.obj) ``` Binutils linker also complains about this, but only with warnings. `FormalArgHandler` has a base class `M68kIncomingValueHandler` which doesn't have a virtual method `markPhysRegUsed` like `IncomingValueHandler`s for all other targets including PPC, so it results in a conflict. The simplest fix is to rename the `FormalArgHandler` structure (rather than to add virtual methods for compatibility). cc rust-lang/rust#107668
You get an error like this:
I didn't investigate it further.
It never worked in the past and I assumed it's due to the old mingw version on CI, but it still doesn't work after #100178 and the actual error doesn't look like it's caused by a toolchain version.
The text was updated successfully, but these errors were encountered: