[ECOS] ecos-3.0 in linux target segfault

Bart Veer bartv@ecoscentric.com
Wed Feb 3 11:32:00 GMT 2010


>>>>> "Daniel" == Daniel Widyanto <daniel.widyanto@yahoo.com> writes:

    Daniel> Hi all,
    Daniel> I have just downloaded ecos-3.0 using ecos-install.tcl. I
    Daniel> want to evaluate ecos in my PC, before committing effort
    Daniel> to run it in LPC17xx (ARM Cortex-M3 platform).

    <snip>
    Daniel> (gdb) run
    Daniel> Starting program: /home/nxp/projects/x86_ecos/app/hello/a.out 

    Daniel> Program received signal SIGSEGV, Segmentation fault.
    Daniel> synth_hardware_init () at /home/nxp/projects/x86_ecos/ecos-3.0/packages/hal/synth/arch/v3_0/src/synth_intr.c:1235
    Daniel> 1235	{
    Daniel> (gdb) 
    Daniel> --------------------------------------------

    Daniel> Is there anything that I can do to fix this one ?

Unfortunately the synthetic target can be more sensitive to
enviromental effects than real targets. Physical hardware like an
stm3210e_eval board or an m5272c3 board can be expected to behave the
same way now as when the port was originally done, because the
hardware is exactly the same. The synthetic target can stop working
because of underlying changes in the Linux kernel, the toolchain
supplied by your Linux distributor, etc.

In this case, the problem is almost certainly caused by the Ubuntu
folks changing the default setting of one of the compiler flags from
-fno-stack-protector to -fstack-protector. The latter requires
additional run-time support which was not implemented at the time of
the 3.0 release, so as soon as you hit the first bit of code
implemented in C you get a segv when the compiled code attempts a
stack protection check.

There are two solutions. If you want to stick with the 3.0 release
then you need to add -fno-stack-protector to the global compiler
flags. Alternatively you can switch to the anoncvs sources which
contain the following fix for the synthetic target (amongst others):

2009-08-11  Bart Veer  <bartv@ecoscentric.com>

	* src/tls.c: new module for TLS (thread local storage) support as
	expected by gcc.

	* cdl/hal_synth_i386.cdl, include/var_arch.h,
	include/pkgconf/mlt_synth_i386_rom.ldi, src/vectors.s: add TLS
	support.

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
Besuchen Sie uns vom 2-4 März auf der Embedded World 2010, Stand 11-208
Visit us at Embedded World 2010, Nürnberg-Germany, 2-4 Mar, Stand 11-208

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list