0

Code:

double a = 1.1;
double b = 2.2;
void test(void)
{
    double c = a + b; // <-- This line generates the __aeabi_dadd function.
}

When I try to compile, I get undefined reference to __aeabi_dadd.

I don't want to use newlib, but it looks like I am forced to.

Help me please.

  • Your compiler is generating code that uses software implementation for floating point math. Does your CPU have hardware support for floating points ? – nos Nov 25 '16 at 15:52
  • No, I want the software implementation. I just don't want newlib and the printf() functions, because I have my own, which are fine. –  Nov 25 '16 at 15:53
  • Aren't these defined in libgcc? – yugr Nov 25 '16 at 16:11
  • @yugr yes, but libgcc also contains newlib. I **do not want** newlib. –  Nov 25 '16 at 16:12
  • Well, if your code uses softfp you have to get it somewhere. Note that linker won't include parts of newlib unless you actually use them (e.g. printf). – yugr Nov 25 '16 at 16:13
  • @yugr well, I have my own `printf()`. I want the aeabi functions without newlib getting in my way. –  Nov 25 '16 at 16:27
  • "I want the aeabi functions without newlib getting in my way" - but it won't! If you have printf defined in your object files, compiler will only include the necessary softfp bits and not the newlib's printf machinery. That's how static libs work. – yugr Nov 25 '16 at 16:40
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/129065/discussion-between-mark-yisri-and-yugr). –  Nov 25 '16 at 18:12

0 Answers0