energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
795 stars 671 forks source link

FIXED — StellarPad Linking Error #122

Closed rei-vilo closed 11 years ago

rei-vilo commented 11 years ago

When building and linking a medium sized project, I have this error message from Energia at the linking stage:

mySketch.cpp.o: In function __static_initialization_and_destruction_0': mySketch.cpp:88: undefined reference to__dso_handle' /Applications/Energia.app/Contents/Resources/Java/hardware/tools/lm4f/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/lib/thumb/armv7e-m/fpu/fpv4-sp-d16/libc.a(lib_a-sbrkr.o): In function _sbrk_r': /Users/rwessels/yagarto/newlib-build/arm-none-eabi/thumb/armv7e-m/fpu/fpv4-sp-d16/newlib/libc/reent/../../../../../../../../../newlib-1.20.0/newlib/libc/reent/sbrkr.c:58: undefined reference to_sbrk' /Applications/Energia.app/Contents/Resources/Java/hardware/tools/lm4f/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/ld: mySketch.cpp.elf: hidden symbol `__dso_handle' isn't defined /Applications/Energia.app/Contents/Resources/Java/hardware/tools/lm4f/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status

RickKimball commented 11 years ago

This is because _sbrk() hasn't been implemented yet. It is used by newlib to allocate memory on the heap. I'm looking at the best way to implement both the stack and the heap. If you use malloc or new those calls will not work until this code is implemented. It might be premature to be filing bugs on something that hasn't even been tested or released from development.

rei-vilo commented 11 years ago

Ok. Thanks.

RickKimball commented 11 years ago

please check commits, this might fix your problem:

https://github.com/energia/Energia/commit/32236716e4493b9154041d9ceaed4997c8417d27

Please give it a try.

-rick

rei-vilo commented 11 years ago

Thanks. _sbrk() seems to be fixed but I'm still having the __dso_handle error.

Energia_Serial_LCD.cpp.o: In function __static_initialization_and_destruction_0': /Applications/Energia_Serial_LCD.ino:92: undefined reference to__dso_handle' /Applications/Energia.app/Contents/Resources/Java/hardware/tools/lm4f/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/ld: Energia_Serial_LCD.cpp.elf: hidden symbol `__dso_handle' isn't defined /Applications/Energia.app/Contents/Resources/Java/hardware/tools/lm4f/bin/../lib/gcc/arm-none-eabi/4.7.1/../../../../arm-none-eabi/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status

On line 92 is declared an object tObject myObject;

RickKimball commented 11 years ago

Where can I find the program source you are testing?

rei-vilo commented 11 years ago

The program is GUI_main.pde using the Serial_LCD library.

This program is used as a test protocol for Arduino-like IDEs. Presently, it works with Arduino 23 and 1.0, chipKIT MPIDE and Wiring.