Skip to content

Undefined reference to __wrap__calloc_r when compiling #312

@sherrellbc

Description

@sherrellbc

I have been playing around with this one for too many hours. If one follows the steps outlined in the QuickStart markdown I am met with this every time. Is anyone else seeing this problem?

The problem only manifests itself once I enabled uVisor; the simply blinky program works fine.

GCC Version
arm-none-eabi-gxx : (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]

Operating System
Arch Linux; Kernel 4.7.0-1-ARCH

$ mbed compile -m K64F -t GCC_ARM
Building project uvisor-example (K64F, GCC_ARM)
Scan: .
Scan: FEATURE_CLIENT
Scan: FEATURE_BLE
Scan: FEATURE_UVISOR
Scan: FEATURE_COMMON_PAL
Scan: FEATURE_STORAGE
Scan: FEATURE_IPV6
Scan: FEATURE_IPV4
Scan: mbed
Scan: env
Link: uvisor-example
/home/user/.programs/gcc-arm-none-eabi-5_4-2016q2/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Warning: alignment 1 of symbol __uvisor_ps' in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MCU_K64F/TARGET_RELEASE/TARGET_M4/libconfiguration_kinetis_m4_0x1fff0000.a(uvisor-output.o) is smaller than 4 in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MCU_K64F/TARGET_RELEASE/TARGET_M4/libconfiguration_kinetis_m4_0x1fff0000.a(disabled.o) /home/user/.programs/gcc-arm-none-eabi-5_4-2016q2/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-mprec.o): In function_Balloc':
mprec.c:(.text._Balloc+0x22): undefined reference to __wrap__calloc_r' mprec.c:(.text._Balloc+0x3e): undefined reference to__wrap__calloc_r'
collect2: error: ld returned 1 exit status
[ERROR] /home/user/.programs/gcc-arm-none-eabi-5_4-2016q2/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Warning: alignment 1 of symbol __uvisor_ps' in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MCU_K64F/TARGET_RELEASE/TARGET_M4/libconfiguration_kinetis_m4_0x1fff0000.a(uvisor-output.o) is smaller than 4 in ./mbed-os/features/FEATURE_UVISOR/targets/TARGET_UVISOR_SUPPORTED/TARGET_MCU_K64F/TARGET_RELEASE/TARGET_M4/libconfiguration_kinetis_m4_0x1fff0000.a(disabled.o) /home/user/.programs/gcc-arm-none-eabi-5_4-2016q2/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-mprec.o): In function_Balloc':
mprec.c:(.text._Balloc+0x22): undefined reference to __wrap__calloc_r' mprec.c:(.text._Balloc+0x3e): undefined reference to__wrap__calloc_r'
collect2: error: ld returned 1 exit status

[mbed] ERROR: "python" returned error code 1.
[mbed] ERROR: Command "python -u /home/user/Desktop/code/uvisor-example/mbed-os/tools/make.py -t GCC_ARM -m K64F --source . --build ./.build/K64F/GCC_ARM" in "/home/user/Desktop/code/uvisor-example"

The appropriate source appears to be present

$ grep -rn "__wrap__calloc_r" .
./mbed-os/hal/common/retarget.cpp:589:void* __wrap__calloc_r(struct ...

Sorry for the poor formatting. I apologize if this turns out to be configuration problem on my end, but nearly a day's worth of research has gotten be no where with this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions