Link error: undefined reference to __divdi3
This article describes how to solve the linker error “undefined referenc to __divdi3”.
Overview
Once a patch or a patch series has been upstreamed, it is run on the Intel test farm. The test farm runs tests with the new patch. This also includes running the new kernel on different platforms. This is generally a mix of 32 and 64 bit platforms. Before running the patch on the different platforms, it is build. During the build it is possible that errors like the one below are raised:
|
|
The error is caused by a division of the long long data type on 32 bit platforms. 32 bit platforms do not support the division of the long long datatype.
By replacing the division with the div_s64
function, the problem can be adressed. Similarly link
errors that reference the __udivdi3
function can be handled.