[ell-i-developers] Re: Ellduino Emulator: Fixing issues for Linux (Ubuntu 12.04 LTS)

  • From: Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Tue, 4 Mar 2014 23:02:55 +0200

With new clone from Runtime git repo, I managed to run emulator

I noticed that in fresh clone with fixes integrated to Runtime for emulator
in Linux environment ... in emulator.mk file there are still uses of
-std=c++98 instead of c++11.

Moreover, the tests cases got compiled but I got same error as Eero Hakala:

test_SPI_begin.o:(.rodata._ZL5SPI_2+0x4): undefined reference to `spimap2'
test_SPI_begin.o:(.rodata._ZL3SPI+0x4): undefined reference to `spimap1'

But, other test cases are running for me.

Also, the linker script didn't complained ... see below from cmd compile
and linking lines:








*make -C test_digitalWrite -f `pwd`/../make/app.mk <http://app.mk>
TOP=`pwd`/../ APP=test_digitalWrite PLATFORM=emulator allmake[1]: Entering
directory
`/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/test_digitalWrite'g++
-c -std=c++11 -g -Os -Wall -ffunction-sections -fdata-sections -fno-common
-nostdlib -m32 -march=i386 -DF_CPU=48000000L -DARDUINO=1.5.4
-DELLI_STM32F051_ELLDUINO -DARDUINO_ARCH_STM32 -fno-rtti -fno-exceptions
-fno-threadsafe-statics -DEMULATOR -D__STM32F051__ -Dmain=emulated_main
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../emulator/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../cores/arduelli
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/CMSIS/Include
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../variants/ellduino
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../libraries/SPI/.
-c -o main.o
/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../cores/arduelli/main.cppg++
-c -std=c++11 -g -Os -Wall -ffunction-sections -fdata-sections -fno-common
-nostdlib -m32 -march=i386 -DF_CPU=48000000L -DARDUINO=1.5.4
-DELLI_STM32F051_ELLDUINO -DARDUINO_ARCH_STM32 -fno-rtti -fno-exceptions
-fno-threadsafe-statics -DEMULATOR -D__STM32F051__ -Dmain=emulated_main
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../emulator/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../cores/arduelli
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/CMSIS/Include
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../variants/ellduino
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../libraries/SPI/.
-c -o test_digitalWrite.o test_digitalWrite.cppg++ -c -std=c++11 -g -Os
-Wall -ffunction-sections -fdata-sections -fno-common -nostdlib -m32
-march=i386 -DF_CPU=48000000L -DARDUINO=1.5.4 -DELLI_STM32F051_ELLDUINO
-DARDUINO_ARCH_STM32 -fno-rtti -fno-exceptions -fno-threadsafe-statics
-DEMULATOR -D__STM32F051__ -Dmain=emulated_main
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../emulator/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../cores/arduelli
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/inc
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../system/stm32/CMSIS/Include
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../variants/ellduino
-I/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../libraries/SPI/.
-c -o ellduino.o
/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../variants/ellduino/ellduino.cppg++
-m32 -march=i386 -m32 -demangle -march=i386 -Xlinker -T -Xlinker
/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../scripts//elf_i386.xc
-o test_digitalWrite  main.o test_digitalWrite.o ellduino.o "-L."
"-L/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/../variants/ellduino"
"-lstm32f0" -lstdc++  :  test_digitalWrite test_digitalWrite.hexmake[1]:
Leaving directory
`/home/asif/Ell-i/Ell-i-March-2014/Runtime/stm32/tests/test_digitalWrite'*




BR,
Asif Sardar.


On Tue, Mar 4, 2014 at 10:20 PM, Asif Sardar <
engr.asif.sardar@xxxxxxxxxxxxxx> wrote:

> The same problem occured for me for _exit(0), but removing _ made it
> compiled for me. Moreover, it didn't complained for me for the linker ...
> in my local copy. I will check it also with fresh clone from git repository
> again ...
> On Mar 5, 2014 12:39 AM, "Pekka Nikander" <pekka.nikander@xxxxxx> wrote:
>
>> > Hi all, when running make in tests directory, the linker got lost again
>> because the path was at a deeper level... Now it is corrected (after Pekka
>> accepts my pull request)!
>>
>> Thanks, merged.
>>
>> > All in all tests went well, system didn't like _exit(0) so I just
>> commented it away...
>>
>> What do you mean it "didn't like"?  Didn't compile?  Crashed?  If
>> crashed, what does gdb say?
>>
>>   $ gdb binary
>>   run
>>   where
>>
>> > ./test_SPI_begin: NOK, got errors
>> > test_SPI_begin.o: In function `SPIClass::begin(unsigned char) const':
>> >
>> /home/eero/sw-engineering/sulautetut/eeronomarepo/Runtime/stm32/tests/../libraries/SPI/./SPIClass.h:83:
>> undefined reference to `spi_master_begin'
>> > test_SPI_begin.o:(.rodata._ZL5SPI_2+0x4): undefined reference to
>> `spimap2'
>> > test_SPI_begin.o:(.rodata._ZL3SPI+0x4): undefined reference to `spimap1'
>> > collect2: error: ld returned 1 exit status
>> > make[1]: *** [test_SPI_begin] Error 1
>> > make: *** [test_SPI_begin] Error 2
>>
>> I think Ivan saw this also when compile for the real board.  I think he
>> has fixed it in his copy, but just haven't been able to produce a pull
>> request yet.
>>
>> --Pekka
>>
>>
>>


-- 



*With Best Regards,Asif Sardar.+358 43 8265795*

Other related posts: