Heap functions not weak for AVR teensy boards

Status
Not open for further replies.

xxxajk

Well-known member
Just like the title says, malloc and friends can not be over rode by a library.
The same code I am using works fine on all AVR based Arduino boards.
Without this fixed the advanced features of UHS30 will be unusable on Teensy 2.0 and Teensy 2.0++.
I know you are VERY busy Paul, but a fix in the next TeensyDuino would be nice.

Prerequisite libraries: https://github.com/felis/UHS30
source code: https://github.com/felis/UHS30/blob/master/libraries/UHS_BULK_STORAGE/examples/USB_HOST_SHIELD/TEST_BULK/TEST_BULK.ino

Here is the (obvious) link error output:
Code:
"/opt/arduino-1.6.6/hardware/tools/avr/../avr/bin/avr-gcc" -Os -Wl,--gc-sections,--relax  -mmcu=at90usb1286 -o "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/TEST_BULK.ino.elf" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/sketch/TEST_BULK.ino.cpp.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/mlock.c.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/SPI/SPI.cpp.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/Wire/Wire.cpp.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/Wire/utility/twi.c.o" "/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a" "-L/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp" -lm
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `malloc'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:390: first defined here
/opt/arduino-1.6.6/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/bin/ld: Disabling relaxation: it will not work with multiple definitions
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `__malloc_heap_start'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:72: first defined here
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `__malloc_heap_end'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:72: first defined here
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `__malloc_margin'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:72: first defined here
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `free'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:94: first defined here
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/core/core.a(malloc.c.o): In function `malloc':
/opt/arduino-1.6.6/hardware/teensy/avr/cores/teensy/malloc.c:75: multiple definition of `realloc'
/tmp/build2f99bf85ee53d3523d9b97b264dc8aa1.tmp/libraries/UHS_host/malloc.c.o:/root/Arduino/libraries/UHS_host/malloc.c:94: first defined here
collect2: error: ld returned 1 exit status
 
Status
Not open for further replies.
Back
Top