Skip to content

Conversation

@heiher
Copy link
Member

@heiher heiher commented Nov 23, 2023

This library function only exists in compiler-rt not libgcc. So this would fail to link unless we were linking with compiler-rt.

Fixes ClangBuiltLinux/linux#1958

@llvmbot
Copy link
Member

llvmbot commented Nov 23, 2023

@llvm/pr-subscribers-backend-loongarch

Author: hev (heiher)

Changes

This library function only exists in compiler-rt not libgcc. So this would fail to link unless we were linking with compiler-rt.

Fixes ClangBuiltLinux/linux#1958


Full diff: https://github.com/llvm/llvm-project/pull/73199.diff

1 Files Affected:

  • (modified) llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp (+5)
diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index f3f72e74ef085a2..ac78789c2c331df 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -152,8 +152,13 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM,
 
     // Set libcalls.
     setLibcallName(RTLIB::MUL_I128, nullptr);
+    // The MULO libcall is not part of libgcc, only compiler-rt.
+    setLibcallName(RTLIB::MULO_I64, nullptr);
   }
 
+  // The MULO libcall is not part of libgcc, only compiler-rt.
+  setLibcallName(RTLIB::MULO_I128, nullptr);
+
   setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Custom);
 
   static const ISD::CondCode FPCCToExpand[] = {

Copy link
Contributor

@SixWeining SixWeining left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to add some tests.

Copy link
Contributor

@SixWeining SixWeining left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This library function only exists in compiler-rt not libgcc. So
this would fail to link unless we were linking with compiler-rt.

Fixes ClangBuiltLinux/linux#1958
@heiher heiher merged commit 0d9f557 into llvm:main Nov 23, 2023
@heiher heiher deleted the disable-muloti4 branch November 23, 2023 12:31
leecheechen pushed a commit to leecheechen/llvm-project that referenced this pull request Jun 9, 2025
This library function only exists in compiler-rt not libgcc. So this
would fail to link unless we were linking with compiler-rt.

Fixes ClangBuiltLinux/linux#1958

(cherry picked from commit 0d9f557)
Change-Id: Ie95d3bccc70b3b9a7aedd590864dd4e8f9cd7d6b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__muloti4 generated after "buffer: Fix grow_buffers() for block size > PAGE_SIZE"

3 participants