public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* problem when making a new target
@ 2003-05-19 15:33 Roger.Gough
  2003-05-19 15:54 ` Andreas Jaeger
  0 siblings, 1 reply; 4+ messages in thread
From: Roger.Gough @ 2003-05-19 15:33 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hi all,

I am trying to target a new architecture with gcc version 3.2.2. I have
modified the configure scripts successfully to recognise my new target
(called 'npe'). I have also written my target files, i.e npe.c, npe.h and
npe.md and placed them in gcc-3.2.2/gcc/config/gcc.

However when I  'make', I get the following error:

In file included from /home/rgough/gcc-3.2.2/gcc/c-decl.c:30:
/home/rgough/gcc-3.2.2/gcc/system.h:589:21: warning: poisoning existing
macro "ASM_OPEN_PAREN"
/home/rgough/gcc-3.2.2/gcc/system.h:589:36: warning: poisoning existing
macro "ASM_CLOSE_PAREN"
/home/rgough/gcc-3.2.2/gcc/system.h:590:9: warning: poisoning existing macro
"FUNCTION_PROLOGUE"
/home/rgough/gcc-3.2.2/gcc/system.h:590:27: warning: poisoning existing
macro "FUNCTION_EPILOGUE"
/home/rgough/gcc-3.2.2/gcc/system.h:605:23: warning: poisoning existing
macro "EASY_DIV_EXPR"
/home/rgough/gcc-3.2.2/gcc/system.h:605:37: warning: poisoning existing
macro "IMPLICIT_FIX_EXPR"
/home/rgough/gcc-3.2.2/gcc/system.h:606:54: warning: poisoning existing
macro "ASM_IDENTIFY_GCC"
/home/rgough/gcc-3.2.2/gcc/system.h:609:9: warning: poisoning existing macro
"BLOCK_PROFILER"
/home/rgough/gcc-3.2.2/gcc/system.h:609:44: warning: poisoning existing
macro "FUNCTION_BLOCK_PROFILER"
/home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `get_parm_info':
/home/rgough/gcc-3.2.2/gcc/c-decl.c:5360: parse error before '(' token
/home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `store_parm_decls':
/home/rgough/gcc-3.2.2/gcc/c-decl.c:6710: parse error before '(' token
make[1]: *** [c-decl.o] Error 1
make: *** [all-gcc] Error 2

From my limited knowledge of porting gcc, I would have thought that it would
not be necessary to touch this file. Indeed I presumed, that I would only
need to modify my target files once gcc recognised my target after
configuration.

My question is will I have to modify this c-decl.c file or is the problem
actually with my target files? How can I go about trouble shooting this?

Thanks for reading, hope you can offer some advice:)

Kind Regards

Roger

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

* Re: problem when making a new target
  2003-05-19 15:33 problem when making a new target Roger.Gough
@ 2003-05-19 15:54 ` Andreas Jaeger
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Jaeger @ 2003-05-19 15:54 UTC (permalink / raw)
  To: Roger.Gough; +Cc: 'gcc@gcc.gnu.org'

"Roger.Gough" <Roger.Gough@ul.ie> writes:

> Hi all,
>
> I am trying to target a new architecture with gcc version 3.2.2. I have
> modified the configure scripts successfully to recognise my new target
> (called 'npe'). I have also written my target files, i.e npe.c, npe.h and
> npe.md and placed them in gcc-3.2.2/gcc/config/gcc.
>
> However when I  'make', I get the following error:
>
> In file included from /home/rgough/gcc-3.2.2/gcc/c-decl.c:30:
> /home/rgough/gcc-3.2.2/gcc/system.h:589:21: warning: poisoning existing
> macro "ASM_OPEN_PAREN"
> /home/rgough/gcc-3.2.2/gcc/system.h:589:36: warning: poisoning existing
> macro "ASM_CLOSE_PAREN"
> /home/rgough/gcc-3.2.2/gcc/system.h:590:9: warning: poisoning existing macro
> "FUNCTION_PROLOGUE"
> /home/rgough/gcc-3.2.2/gcc/system.h:590:27: warning: poisoning existing
> macro "FUNCTION_EPILOGUE"
> /home/rgough/gcc-3.2.2/gcc/system.h:605:23: warning: poisoning existing
> macro "EASY_DIV_EXPR"
> /home/rgough/gcc-3.2.2/gcc/system.h:605:37: warning: poisoning existing
> macro "IMPLICIT_FIX_EXPR"
> /home/rgough/gcc-3.2.2/gcc/system.h:606:54: warning: poisoning existing
> macro "ASM_IDENTIFY_GCC"
> /home/rgough/gcc-3.2.2/gcc/system.h:609:9: warning: poisoning existing macro
> "BLOCK_PROFILER"
> /home/rgough/gcc-3.2.2/gcc/system.h:609:44: warning: poisoning existing
> macro "FUNCTION_BLOCK_PROFILER"
> /home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `get_parm_info':
> /home/rgough/gcc-3.2.2/gcc/c-decl.c:5360: parse error before '(' token
> /home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `store_parm_decls':
> /home/rgough/gcc-3.2.2/gcc/c-decl.c:6710: parse error before '(' token
> make[1]: *** [c-decl.o] Error 1
> make: *** [all-gcc] Error 2
>
> From my limited knowledge of porting gcc, I would have thought that it would
> not be necessary to touch this file. Indeed I presumed, that I would only
> need to modify my target files once gcc recognised my target after
> configuration.
>
> My question is will I have to modify this c-decl.c file or is the problem
> actually with my target files? How can I go about trouble shooting this?

The problem is with your target file.  You use the macros above,
e.g. BLOCK_PROFILER in your target files and those macros are
forbidden.  We explicitly have poisoned them so that you do not use
them ;)

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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

* Re: problem when making a new target
  2003-05-23 14:59 Roger.Gough
@ 2003-05-23 15:07 ` Alexandre Courbot
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Courbot @ 2003-05-23 15:07 UTC (permalink / raw)
  To: Roger.Gough, 'gcc@gcc.gnu.org'

> Can I comment out the #pragmas in system.h and hence use the macros which
> otherwise would have been poisoned? If not how am I going to implement my
> function_epilogue and function_prologue?

All the poisonned macros have been replaced by target hooks. You should use 
them instead, it will be little effort to port your macros to target hooks 
anyway. For instance, FUNCTION_PROLOGUE has been replaced by 
ASM_TARGET_FUNCTION_PROLOGUE. These macros should no longer be defined in 
your target.h file, but rather in target.c. You can use the following scheme 
to set the hooks correctly (for FUNCTION_PROLOGUE and FUNCTION_EPILOGUE in 
the example below):

#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE my_prologue_function

#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE my_epilogue_function

/* Setup the targetm global variable */
struct gcc_target targetm = TARGET_INITIALIZER;

targetm is a structure which contains pointers to functions. By undefining and 
redefining the target hooks, you substitute your own functions to the default 
ones. TARGET_INITIALIZER is an initializer made of the target hooks. If you 
need more informations about target hooks, the manual is quite explicit on 
them 
(http://gcc.gnu.org/onlinedocs/gccint/Target-Structure.html#Target%20Structure). 
Chapter 10 also contains a list of the hooks and their format along with the 
macros.

Alex.

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

* Re: problem when making a new target
@ 2003-05-23 14:59 Roger.Gough
  2003-05-23 15:07 ` Alexandre Courbot
  0 siblings, 1 reply; 4+ messages in thread
From: Roger.Gough @ 2003-05-23 14:59 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'; +Cc: 'aj@suse.de'


Thanks Andreas for that.

I think i have a bigger problem so. The target files that I am using work on
gcc-2.95. I have modified these files slightly so suit my criteria and I
want to use these on gcc3.2.2.

Can I comment out the #pragmas in system.h and hence use the macros which
otherwise would have been poisoned? If not how am I going to implement my
function_epilogue and function_prologue?

Thanks

Rgds

Roger


> Hi all,
>
> I am trying to target a new architecture with gcc version 3.2.2. I have
> modified the configure scripts successfully to recognise my new target
> (called 'npe'). I have also written my target files, i.e npe.c, npe.h and
> npe.md and placed them in gcc-3.2.2/gcc/config/gcc.
>
> However when I  'make', I get the following error:
>
> In file included from /home/rgough/gcc-3.2.2/gcc/c-decl.c:30:
> /home/rgough/gcc-3.2.2/gcc/system.h:589:21: warning: poisoning existing
> macro "ASM_OPEN_PAREN"
> /home/rgough/gcc-3.2.2/gcc/system.h:589:36: warning: poisoning existing
> macro "ASM_CLOSE_PAREN"
> /home/rgough/gcc-3.2.2/gcc/system.h:590:9: warning: poisoning existing
macro
> "FUNCTION_PROLOGUE"
> /home/rgough/gcc-3.2.2/gcc/system.h:590:27: warning: poisoning existing
> macro "FUNCTION_EPILOGUE"
> /home/rgough/gcc-3.2.2/gcc/system.h:605:23: warning: poisoning existing
> macro "EASY_DIV_EXPR"
> /home/rgough/gcc-3.2.2/gcc/system.h:605:37: warning: poisoning existing
> macro "IMPLICIT_FIX_EXPR"
> /home/rgough/gcc-3.2.2/gcc/system.h:606:54: warning: poisoning existing
> macro "ASM_IDENTIFY_GCC"
> /home/rgough/gcc-3.2.2/gcc/system.h:609:9: warning: poisoning existing
macro
> "BLOCK_PROFILER"
> /home/rgough/gcc-3.2.2/gcc/system.h:609:44: warning: poisoning existing
> macro "FUNCTION_BLOCK_PROFILER"
> /home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `get_parm_info':
> /home/rgough/gcc-3.2.2/gcc/c-decl.c:5360: parse error before '(' token
> /home/rgough/gcc-3.2.2/gcc/c-decl.c: In function `store_parm_decls':
> /home/rgough/gcc-3.2.2/gcc/c-decl.c:6710: parse error before '(' token
> make[1]: *** [c-decl.o] Error 1
> make: *** [all-gcc] Error 2
>
> From my limited knowledge of porting gcc, I would have thought that it
would
> not be necessary to touch this file. Indeed I presumed, that I would only
> need to modify my target files once gcc recognised my target after
> configuration.
>
> My question is will I have to modify this c-decl.c file or is the problem
> actually with my target files? How can I go about trouble shooting this?

The problem is with your target file.  You use the macros above,
e.g. BLOCK_PROFILER in your target files and those macros are
forbidden.  We explicitly have poisoned them so that you do not use
them ;)

Andreas

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

end of thread, other threads:[~2003-05-23 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-19 15:33 problem when making a new target Roger.Gough
2003-05-19 15:54 ` Andreas Jaeger
2003-05-23 14:59 Roger.Gough
2003-05-23 15:07 ` Alexandre Courbot

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).