blackmagic-debug / blackmagic

In application debugger for ARM Cortex microcontrollers.
GNU General Public License v3.0
3.2k stars 764 forks source link

Implicit function declaration #889

Closed JDuchniewicz closed 2 years ago

JDuchniewicz commented 3 years ago

I am trying to build bmp with target PROBE_HOSH=swlink and I am getting these errors:

target/efm32.c: In function ‘efm32_probe’:
target/efm32.c:645:2: error: implicit declaration of function ‘sniprintf’ [-Werror=implicit-function-declaration]
  snprintf(priv_storage->efm32_variant_string,
  ^
target/efm32.c: In function ‘efm32_aap_probe’:
target/efm32.c:1018:2: error: implicit declaration of function ‘siprintf’ [-Werror=implicit-function-declaration]
  sprintf(priv_storage->aap_driver_string,
  ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:99: efm32.o] Error 1
make: *** [Makefile:17: all] Error 2

I installed arm-none-eabi-{gcc, newlib}.

UweBonnes commented 3 years ago

Check your installation of newlib/nanolib! Who does provide newlib on your system? I use https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

JDuchniewicz commented 3 years ago

I installed a package from AUR (Arch Linux, usually it should just work). Maybe the newlib differs (is newer probably) from the ones tested usually on.

UweBonnes commented 3 years ago

Try to compile with the whole block of sniprintf and friends defines removed. For me, a test resulted in a binary 20 byte larger.

esden commented 2 years ago

@JDuchniewicz were you able to compile the firmware? If not I can check how my setup looks like on arch and update the documentation.

JDuchniewicz commented 2 years ago

I settled for the pre-built binary if I correctly remember.

esden commented 2 years ago

Ok, that sounds good. I will close this issue then. :)

JDuchniewicz commented 2 years ago

Hopefully it won't bite back in the future (maybe it was just due to toolchain misconfiguration or exotic hardware setup 🤷🏽)

esden commented 2 years ago

That is, ok. If you run into this issue in the future we can take a look and see what might be the problem. Feel free to reopen the issue then. :)