Link error: undefined reference to `__mulodi4' with Clang 32-bit

Stephan Bergmann sbergman at
Tue May 2 12:20:23 UTC 2017

On 05/01/2017 05:09 PM, Luke Benes wrote:
> /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'

I assume the reference to __mulodi4 stems from

> #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);
> }
> #else

in include/o3tl/safeint.hxx.  Whatever the trouble with your toolchain 
there, if you cannot get it solved one option would be to tweak the 
#elif so that you use the #else fallback implementation of 
checked_multiply instead.

More information about the LibreOffice mailing list