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

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Sat, 15 Feb 2014 07:24:03 +0200

>     1- With following line at emulator.txt file at path 
> ....../Runtime/stm32/make/
>         compiler.cflags.target=    -m32 -march=i386 
>         
>            I get errors:
>            g++: error: unrecognized argument in option '-march=i386'
>            g++: error: unrecognized command line option '-m32'

Hmm.  This is very strange.  Are you sure you are using an i386 compiler, i.e. 
a native Linux compiler?  

As Arduino is moving to arm-gcc 4.8.3 for Arduino Due, and we will be moving to 
arm-gcc 4.8 for our board-native binaries, for the emulator we must match that 
with an i386-gcc 4.8.x.  Or, actually, i386-gcc 4.7.x is enough. I'm using 
myself gcc 4.7.1 because I'm too lazy to move to 4.8 at the moment.  Hence, we 
will continue to support gcc 4.7 for a while, too.

Hence, you have to install gcc 4.8.3-latest (or 4.7.latest) as a native 
compiler to your Linux, and compile the emulator with that.   I don't know 
Linux well enough so that I could help in that. 

>     2- However, commenting above, I get .o for all emulator c++ code, except 
> for emulator_pre.c and emulator_post.c. I get             
>         following error for these:
> ...
> make PLATFORM=emulator -f ../make/app.mk all
> make[1]: Entering directory `/home/asif/Ell-i/Runtime/stm32/build'
> g++ -c -std=c++98 -g -Os -Wall -ffunction-sections -fdata-sections 
> -fno-common -nostdlib  -mthumb -DF_CPU=48000000L -DARDUINO=1.5.4 
> -DELLI_STM32F051_ELLDUINO -DARDUINO_ARCH_STM32 -DEMULATOR -D__STM32F051__ 
> -Dmain=emulated_main -I../emulator/inc -I../cores/arduelli 
> -I../system/stm32/inc -I../system/stm32/CMSIS/Include -I../variants/ellduino  
>   -c -o emulator_pre.o ../emulator/src/emulator_pre.c
>            /tmp/ccklpwuF.s: Assembler messages:
>            /tmp/ccklpwuF.s:18: Error: character following name is not '#'
>            make[1]: *** [emulator_pre.o] Error 1

Firstly, you still have -std=c++98 there.  That is wrong, please go back to 
C++11 standard.  You will hit problems later on, we *are* using C++11 constexpr 
and some other C++11 stuff, and those parts of the source won't compile with 
c++98.

Second, it looks very much like the g++ you are using on the command line is an 
arm-gcc, not i386-gcc, as it seems to accept the -mthumb flag and especially if 
it is complaining about -march=i386.

Hence, I'm suspecting that you are somehow using a wrong version of the 
compiler.  Please check.

-----

Hmm.  I expect this is quite normal and that we will encounter this many times 
as more people come along.  It is often very confusing with multiple compilers 
when working with embedded systems.  

Hence it would be very good to write a wiki page on the compilation 
environment, creating very clear instructions how to compile the arm-gcc cross 
compiler for the board-native binaries and how to compile the i386-gcc native 
compiler for the emulator binaries.

Anyone wants to help Asif in creating such a wiki page?  Teemu?  Eero?  Ivan?

--Pekka


Other related posts: