This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Redboot compilation problems
- From: Lars Poeschel <larsi at wh2 dot tu-dresden dot de>
- To: ecos-patches at ecos dot sourceware dot org
- Cc: Paul Chavent <paul dot chavent at free dot fr>
- Date: Fri, 11 Jan 2008 14:26:05 +0100
- Subject: Re: Redboot compilation problems
- References: <47876537.8010808@free.fr>
On Freitag, 11. Januar 2008, Paul Chavent wrote:
> Good morning.
>
> When i compile redboot i get this error :
>
> 8<-------------------------------------
>
> make -r -C redboot/current build
> make[1]: Entering directory `/opt/gba/ecos/untitled_build/redboot/current'
> arm-thumb-elf-gcc -c -I/opt/gba/ecos/untitled_install/include
> -I/home/paul/Gba/sources/ecos/packages/redboot/current
> -I/home/paul/Gba/sources/ecos/packages/redboot/current/src
> -I/home/paul/Gba/sources/ecos/packages/redboot/current/tests -I.
> -I/home/paul/Gba/sources/ecos/packages/redboot/current/src/
> -finline-limit=7000 -mthumb-interwork -Wall -Wpointer-arith
> -Wstrict-prototypes -Winline -Wundef -g -O2 -ffunction-sections
> -fdata-sections -fno-exceptions -Wp,-MD,src/main.tmp -o
> src/redboot_main.o
> /home/paul/Gba/sources/ecos/packages/redboot/current/src/main.c
> make[1]: Leaving directory `/opt/gba/ecos/untitled_build/redboot/current'
> /home/paul/Gba/sources/ecos/packages/redboot/current/src/main.c: In
> function 'cyg_start':
> make: Leaving directory `/opt/gba/ecos/untitled_build'
> /home/paul/Gba/sources/ecos/packages/redboot/current/src/main.c:397:
> error: lvalue required as left operand of assignment
>
> /home/paul/Gba/sources/ecos/packages/redboot/current/src/main.c: In
> function 'do_go':
> /home/paul/Gba/sources/ecos/packages/redboot/current/src/main.c:603:
> error: lvalue required as left operand of assignment
> make[1]: *** [src/main.o.d] Error 1
> make: *** [build] Error 2
>
...
> The atached patch solve this problem.
>
> Thanks for your comments.
Hi!
I also have the problem using a recent gcc version.
The problem with your patch is that a compiler warning is generated about not
converted types in an assignment.
I'd suggest the attatched solution.
Lars
Index: packages/redboot/current/src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.66
diff -n -U3 -r1.66 main.c
--- packages/redboot/current/src/main.c 20 Jul 2006 20:27:47 -0000 1.66
+++ packages/redboot/current/src/main.c 11 Jan 2008 13:25:22 -0000
@@ -394,8 +394,10 @@
CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
// set up a temporary context that will take us to the trampoline
- HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end,
+ CYG_ADDRWORD workspace_temp = (CYG_ADDRWORD)workspace_end;
+ HAL_THREAD_INIT_CONTEXT(workspace_temp,
breakpoint, trampoline,0);
+ workspace_end = (unsigned char *)workspace_temp;
// switch context to trampoline (get GDB stubs started)
HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end);
@@ -600,8 +602,10 @@
HAL_ICACHE_INVALIDATE_ALL();
HAL_DCACHE_INVALIDATE_ALL();
// set up a temporary context that will take us to the trampoline
- HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end,
+ CYG_ADDRWORD workspace_temp = (CYG_ADDRWORD)workspace_end;
+ HAL_THREAD_INIT_CONTEXT(workspace_temp,
entry, trampoline, 0);
+ workspace_end = (unsigned char *)workspace_temp;
// switch context to trampoline
HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end);