1

I'm building an app on Raspebian (Rpi3b+) using the gcc-arm-none-eabi toolchain (which I installed via sudo apt-get install gcc-arm-none-eabi).

I successfully compiled my sources, but the linking step:

arm-none-eabi-ld modes.c.o turing.c.o light.c.o dark.c.o pix.c.o --relocatable -o tlrcextractortest -lm

fails with:

arm-none-eabi-ld: cannot find -lm

What could be wrong? Which package do I need to install to get the missing lib?

Danijel
  • 8,198
  • 18
  • 69
  • 133
  • 1
    Can you include in the question the command used to link the program? – Jonathon S. Nov 09 '21 at 12:32
  • 2
    https://stackoverflow.com/questions/6570034/why-does-the-r-option-relocatable-make-ld-not-find-any-libraries why do you use relocatable? – KamilCuk Nov 09 '21 at 12:36
  • 1
    Also, try `apt-get install libnewlib-arm-none-eabi`. It looks like the math libraries are part of a recommended package and not a dependency: https://packages.debian.org/sid/gcc-arm-none-eabi. – Jonathon S. Nov 09 '21 at 12:38
  • 2
    Why do you use the `arm-none-eabi` toolchain? The standard GCC for the Raspi _is_ the arm toolchain. – PMF Nov 09 '21 at 12:43
  • you have to provide the path to the libraries when using ld – old_timer Nov 09 '21 at 20:11
  • if you use gcc to link (ewww) then you dont. – old_timer Nov 09 '21 at 20:12
  • @JonathonS. The lib `libnewlib-arm-none-eabi` I already installed, but it didn't help. – Danijel Nov 10 '21 at 07:30
  • As @PMF suggested, I've given up on this toolchain, and used standard GCC. Even, still don't know why the `lm` lib was missing. – Danijel Dec 09 '21 at 11:17

0 Answers0