public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Macro problem building ecos with powerpc cross-compiler
@ 2005-06-28 10:18 Leo Khale
  2005-07-03  1:04 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Khale @ 2005-06-28 10:18 UTC (permalink / raw)
  To: ecos-discuss

Hi there,

I'm attempting to build an ecos project using a powerpc-eabi 
cross-compiler on Linux. I have successfully built the toolchain but 
have hit a problem compiling the actual code concerning multiply defined 
assembler macros. The error appears while compiling an assembler file 
context.S, and the macros themselves in cyg/hal/arch.inc, for example:

    .macro    lwi    reg,val
    .macro    hal_fpu_load regs

I'm aware that as I compile three separate copies of this arch.inc exist 
on my machine:

- the original one in the ecos_repository/packages tree
- the one copied to my app source tree (with other kernel headers) by 
the ecosconfig tool for compiling my application
- the one present in the headers gnutools/powerpc-eabi/sys-include tree 
for building the cross-compiler

Since the include file is assembler and not guarded, my guess is that 
it's somehow being included twice. Can anyone suggest what might be 
wrong with my setup to cause this, or what the cause might be if not this?

I append an error trace below

Thanks

Leo

powerpc-eabi-gcc -c  
-I/home/leok/dev/projects/architectural/ecos_kernel/full/install/include 
-I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26 
-I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src 
-I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/tests -I. 
-I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src/ 
-finline-limit=7000 -msoft-float -mcpu=860 -Wall -Wpointer-arith 
-Wstrict-prototypes -Winline -Wundef  -g -ffunction-sections 
-fdata-sections -fno-exceptions    -Wp,-MD,src/context.tmp -o 
src/hal_powerpc_arch_context.o 
/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src/context.S
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc: 
Assembler messages:
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:140: 
Error: Macro with this name was already defined
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:171: 
Error: Macro with this name was already defined
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:181: 
Error: Macro with this name was already defined
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:197: 
Error: Macro with this name was already defined
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:207: 
Error: Macro with this name was already defined
/home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:218: 
Error: Macro with this name was already defined
make[1]: *** [src/context.o.d] Error 1
make[1]: Leaving directory 
`/home/leok/dev/projects/architectural/ecos_kernel/full/hal/powerpc/arch/v2_0_26'

-- 
Leo Nitin Khale
leo@raceoddity.net


"I expect history will be kind to me, since I intend to write it."
- Winston Churchill 



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Macro problem building ecos with powerpc cross-compiler
  2005-06-28 10:18 [ECOS] Macro problem building ecos with powerpc cross-compiler Leo Khale
@ 2005-07-03  1:04 ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2005-07-03  1:04 UTC (permalink / raw)
  To: Leo Khale; +Cc: eCos Discussion

On Tue, 2005-06-28 at 11:22 +0100, Leo Khale wrote:
> Hi there,
> 
> I'm attempting to build an ecos project using a powerpc-eabi 
> cross-compiler on Linux. I have successfully built the toolchain but 
> have hit a problem compiling the actual code concerning multiply defined 
> assembler macros. The error appears while compiling an assembler file 
> context.S, and the macros themselves in cyg/hal/arch.inc, for example:
> 
>     .macro    lwi    reg,val
>     .macro    hal_fpu_load regs
> 
> I'm aware that as I compile three separate copies of this arch.inc exist 
> on my machine:
> 
> - the original one in the ecos_repository/packages tree
> - the one copied to my app source tree (with other kernel headers) by 
> the ecosconfig tool for compiling my application
> - the one present in the headers gnutools/powerpc-eabi/sys-include tree 
> for building the cross-compiler
> 
> Since the include file is assembler and not guarded, my guess is that 
> it's somehow being included twice. Can anyone suggest what might be 
> wrong with my setup to cause this, or what the cause might be if not this?
> 
> I append an error trace below
> 
> Thanks
> 
> Leo
> 
> powerpc-eabi-gcc -c  
> -I/home/leok/dev/projects/architectural/ecos_kernel/full/install/include 
> -I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26 
> -I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src 
> -I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/tests -I. 
> -I/home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src/ 
> -finline-limit=7000 -msoft-float -mcpu=860 -Wall -Wpointer-arith 
> -Wstrict-prototypes -Winline -Wundef  -g -ffunction-sections 
> -fdata-sections -fno-exceptions    -Wp,-MD,src/context.tmp -o 
> src/hal_powerpc_arch_context.o 
> /home/leok/ecos_repository/packages/hal/powerpc/arch/v2_0_26/src/context.S
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc: 
> Assembler messages:
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:140: 
> Error: Macro with this name was already defined
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:171: 
> Error: Macro with this name was already defined
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:181: 
> Error: Macro with this name was already defined
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:197: 
> Error: Macro with this name was already defined
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:207: 
> Error: Macro with this name was already defined
> /home/leok/dev/projects/architectural/ecos_kernel/full/install/include/cyg/hal/arch.inc:218: 
> Error: Macro with this name was already defined
> make[1]: *** [src/context.o.d] Error 1
> make[1]: Leaving directory 
> `/home/leok/dev/projects/architectural/ecos_kernel/full/hal/powerpc/arch/v2_0_26'

You need to add some protection to the *.S and *.h files to protect
against this.  The newer tools complain if there are multiple
versions of the same .macro (older tools just replaced them)

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-03  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-28 10:18 [ECOS] Macro problem building ecos with powerpc cross-compiler Leo Khale
2005-07-03  1:04 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).