[llvm-bugs] [Bug 35922] New: Link error: undefined reference to `__mulodi4' with Clang 32-bit (x86-64 works)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 11 20:07:42 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=35922

            Bug ID: 35922
           Summary: Link error: undefined reference to `__mulodi4' with
                    Clang 32-bit (x86-64 works)
           Product: new-bugs
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: lukebenes at hotmail.com
                CC: llvm-bugs at lists.llvm.org

The following commit
https://cgit.freedesktop.org/libreoffice/core/commit/?id=4f0b226600fdad4e5aef9313fe8754c765cfee42
causes the following error:

/core/workdir/CxxObject/tools/source/generic/fract.o: In function
`Fraction::operator*=(Fraction const&)': 
/core/tools/source/generic/fract.cxx:(.text+0x695): undefined reference to
`__mulodi4' 
/core/tools/source/generic/fract.cxx:(.text+0x70a): undefined reference to
`__mulodi4' 
[build CXX] svl/source/config/asiancfg.cxx 
clang-5.0: error: linker command failed with exit code 1 (use -v to see
invocation) 
/core/tools/Library_tl.mk:20: recipe for target
'/core/instdir/program/libtllo.so' failed 
make[1]: *** [/core/instdir/program/libtllo.so] Error 1 

The problem is this code:

#elif (defined __GNUC__ && __GNUC__ >= 5) ||
(__has_builtin(__builtin_mul_overflow))

template<typename T> inline bool checked_multiply(T a, T b, T& result)
{
    return __builtin_mul_overflow(a, b, &result);
}


Steps to reproduce on with 32-bit clang machine:
1. $ git clone git://anongit.freedesktop.org/libreoffice/core
2. $ apt-get build-dep libreoffice 
3. create file autogen.input with CC=clang and CXX=clang++
4 ./autogen.sh && make ENVCFLAGS="-mllvm -no-x86-call-frame-opt"
ENVCFLAGSCXX="-mllvm -no-x86-call-frame-opt"

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180112/bfa19465/attachment-0001.html>


More information about the llvm-bugs mailing list