Question

I'm trying to cross compile some code (tweetnacl) over to arm-none-eabi (bare metal cortex-m3)

It has this function which does a 64-bit rotate:

static u64 R(u64 x,int c) { return (x >> c) | (x << (64 - c)); }

The linker complains that it can't find the routines to do the 64-bit left shift and right shift:

tweetnacl.c:487: undefined reference to `__aeabi_llsr'
tweetnacl.c:487: undefined reference to `__aeabi_llsl'

I can't find much information on these routines. auselen has provided a reference to the correct documentation which defines these functions. Tool chain version that I'm using:

arm-none-eabi-gcc (Sourcery G++ Lite 2010q1-188) 4.4.1

Are implementations present in this tool chain? What possible flags might cause the build process to exclude any compiler provided implementation?


Solution: turns out I needed to link in libgcc.a

Was it helpful?

Solution

See 4.2 The long long helper functions of Run-time ABI for the ARM for the description of what they are and how they are defined.

These kind of helper functions are provided by compiler (not standard lib) and it looks like in your case either you have wrong parameters when invoking the compiler or your installation is not complete (wrong paths, missing files, etc.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top