undefined reference to `__udivdi3' ?

Jan-Benedict Glaw jbglaw@lug-owl.de
Wed Jul 13 14:54:00 GMT 2005


On Wed, 2005-07-13 12:31:32 +0200, Steven Scholz <steven.scholz@imc-berlin.de> wrote:
> When compiling linux-2.6.13-rc3 I get
> 
> arch/arm/kernel/built-in.o(__ksymtab+0x380): undefined reference to 
> `__udivdi3'
> arch/arm/kernel/built-in.o(__ksymtab+0x388): undefined reference to 
> `__umoddi3'
> arch/arm/kernel/built-in.o(__ksymtab+0x390): undefined reference to 
> `__udivmoddi4'
> 
> I am not sure if I understand correctly:
> 
> These functions are for integer arithmetics and should be in libgcc.a.
> They have nothing to do with glibc. Right?

Right.

> My libgcc.a does not have a __udivdi3.
> 
> What can I do to build a gcc-3.3.3 (with libgcc.a) that contains these 
> functions?

Please also keep in mind that there has been a lot of discussion about
this very subject. The resume is that libgcc.a probably shouldn't be
linked into the kernel, but the kernel should provide it's own version
instead.

This is specifically important to architectures where the instruction
set architecture got extended at some point (which is true for most
archs, though...)  Consider as an example a compiler targeted for
i686-pc-linux-gnu. Now consider you're building for an original i486,
using -m486 etc.  The compiler's output _will_ work on a i486, but can
you be 100% sure that the libgcc function (which were already
cross-compiled by this very i686-pc-linux-gnu-gcc compiler!) linked into
the kernel don't contain any i686 instructions?

You cannot. Some kernels (even on different architectures) didn't work
because of this very issue.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
fuer einen Freien Staat voll Freier Buerger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20050713/2d6b98cf/attachment.sig>


More information about the crossgcc mailing list