This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Linking Error (_impure_ptr, __memcpy_chk, ) in Segger Studio

Hello,

I try to use the opus codec on an 52840-DK. The Build and Flash with ARMGCC woks fine (with gcc-arm-none-eabi-8-2019-q3-update) but I'd like to use the debugger from the Segger Studio. When I build the code inside Segger I got these failures.


  Generating linker script 'i2s_pca10056.ld'
  Linking i2s_pca10056.elf
    ../../../../../../external/opus/lib/libopus.a(celt.o): in function `celt_fatal':
    undefined reference to `_impure_ptr'
    ../../../../../../external/opus/lib/libopus.a(bands.o): in function `quant_all_bands':
    undefined reference to `__memcpy_chk'
    ../../../../../../external/opus/lib/libopus.a(PLC.o): in function `silk_PLC_conceal':
    undefined reference to `__memcpy_chk'
    ../../../../../../external/opus/lib/libopus.a(decode_core.o): in function `silk_decode_core':
    undefined reference to `__memcpy_chk'
Build failed

I found it could be related to the newlib-nano or stdlib. Which lib and where can I change it in Segger Studio or .emProject?

  • Hi, 

    Generally, Embedded Studio offers the user to use any standard library they want. First, disable the use of Embedded Studio standard libraries in project options under Library->Include Standard Libraries->No
    To add your library go to project options Linker->Additional Input Files and add your newlib directory there.
    Now try to rebuild your project and you should be good to go.

    From this post

    -Amanda H.

Related