[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: Mon, 17 Feb 2014 15:47:19 +0200

Hello Pekka,

*I think you may be using a 64-bit compiler.  Please try to add -m32 back
to the command line and see what happens.  Maybe also -march=i386.   It may
also be some other problem, due to differences between the GCC settings in
linux and Mac.  At least on the Mac the native compiler supports both
64-bit and 32-bit binaries, and those two flags select the 32-bit binaries.*

I have installed gcc-4.7-multilib g++-4.7-multilib packages. The above
mentioned cast error is being eliminated. Building emulator now gives:


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 -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/cc4s2eZQ.s: Assembler messages:
/tmp/cc4s2eZQ.s:5: Error: character following name is not '#'
make[1]: *** [emulator_pre.o] Error 1
make[1]: Leaving directory `/home/asif/Ell-i/Runtime/stm32/build'
make: *** [all] Error 2


I am getting other binaries, but for emulator_pre.o, there is error
mentioned above. Does it needs changes in compiler/assembler flags ...

Regarding the Wiki, I have noted these points in a file ... after getting
emulator fixed, I will make a WiKi page mentioning problems and its
solutions. I remember, we agreed to meet on Feb 19th at 4pm, Wednesday
regarding test cases ... but we have already discussed that in 12th Feb
meeting. Do we need to meet for test cases, because emulator still needs to
be fixed?





On Mon, Feb 17, 2014 at 6:55 AM, Pekka Nikander <pekka.nikander@xxxxxx>wrote:

> >> 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. ... 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 had been confused with the compilers that we are using separately for
> board (embedded) and
> > for emulator (native Linux compiler). You were right, I was using wrong
> compiler for emulator (arm-gcc same as I used for board).
> >
> > Now my path contains native gcc-4.7 g++-4.7: you may see lines below
> from CMD linux
>
> Excellent that we got that fixed so easily!
>
> >> I tried building the gcc-4.8.x from source, but its not ready yet and
> seems to have dependencies and configuration issues that might need to be
> fixed manually and may need quit advanced level unix/linux shell/scripting
> knowledge. Luckily, I found the test-repositories from Ubuntu official
> websites and installed and configured easily the packages gcc&g++ version
> 4.7 as instructed by them in the website.
>
> Good to know!  If you write a Wiki page of this, it would be good to place
> the links directly there.
>
> > g++: error: unrecognized command line option '-mthumb'
> >
> > When I remove -mthumb from platform.txt file (compiler.cflags.target=
>   -mcpu={build.mcu} -mthumb),
>
> That's the right fix, IIRC.  Eero had the same problem before and fixed
> it, but somehow the fix got lost.
>
> > g++ -c -std=c++11 -g -Os -Wall -ffunction-sections -fdata-sections
> -fno-common -nostdlib  -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 system_init.o
> ../system/stm32/src/system_init.c
> > ../system/stm32/src/system_init.c: In function 'void
> SystemInitPeripherals()':
> > ../system/stm32/src/system_init.c:113:50: error: cast from 'const
> SystemInitRecordArray*' to 'uint32_t {aka unsigned int}' loses precision
> [-fpermissive]
>
> Now we are in real business!  This is the kind of problems that I'm
> expecting.
>
> > Are these problems arising because of MAC related configurations for GCC
> or due to MAC specific code? Or may be I am using 64-bit system and code
> runs on 32-bit system ... In this particular case, what do you suggest?
>
> I think you may be using a 64-bit compiler.  Please try to add -m32 back
> to the command line and see what happens.  Maybe also -march=i386.   It may
> also be some other problem, due to differences between the GCC settings in
> linux and Mac.  At least on the Mac the native compiler supports both
> 64-bit and 32-bit binaries, and those two flags select the 32-bit binaries.
>
> But very good progress anyway!
>
> --Pekka
>
>
>


-- 



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

Other related posts: