Re: [arm-gnu] In Function __aeabi_ldiv0 : undefined reference to 'raise'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] In Function __aeabi_ldiv0 : undefined reference to 'raise'



ananth wrote:

> arm-2008q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/libgcc.a(_dvmd_lnx.o):
> In function `__aeabi_ldiv0':
> 
> (.text+0x8): undefined reference to `raise'

>       Can you please let me know for any linker flags to be changed for
> compiling the u-boot with this toolchain?

U-Boot is not a GNU/Linux application.  However, you're using the
GNU/Linux toolchain to compile it -- so the libraries assume the
presence of a GNU/Linux C library.  In this case, the division routine
wants to call "raise" to signal a division-by-zero exception.

People often try to abuse the GNU/Linux toolchain to build U-Boot
because they want to use the same toolchain that they use to build the
Linux kernel and GNU/Linux applications.  But, U-Boot is really a
bare-metal application, and, as such, should be built with a bare-metal
toolchain, like our "ARM EABI" toolchains.  There are often these kinds
of problems with U-Boot when moving between different architectures or
toolchain versions because the U-Boot source code has tricks to try to
make the GNU/Linux toolchain work, and those tricks only work with
particular toolchains.

That's the long story.

The short story is that you can probably provide an __aeabi_ldiv0
routine that just returns zero, overriding the default implementation.

-- 
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713