public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A question about porting GCC to a javachip
@ 1998-12-18  0:18 edward
  1998-12-21  6:03 ` Jeffrey A Law
  0 siblings, 1 reply; 3+ messages in thread
From: edward @ 1998-12-18  0:18 UTC (permalink / raw)
  To: egcs; +Cc: s892403

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2847 bytes --]

Hi:
    
      I  am  a  
student  who  major  in  Computer  Science , and  
I  have  a  project  for  porting  GCC  
to  a  Java  chip  
      However , when I  start  to  porting  
with  some  implementations , I  encounter some problems  
that  bothering  me .
      I know that there may even be 
people working on similar ports,   so  
I  write  this mail to  you  
wishing   to   get   some   

      help  from  you  
about   the  following  questions . I  hope  
it  would  not   bother  
you   too  much !
 
1.In some porting reports , they indicate that 
it is easy to add a new machine description  to GCC --just add a few lines 
to  
   
"configure.in", but when I try to do it , I 
find that I have to create my javachip.h(tm.h) 
&javachip.c(tm.c)&javachip.md(.md
    file) first in 
order  to   avoid 
some unexpecting problems.Is it correct ? I mean that whether I have to handle  1.configure.in 

    2.tm.h 3.tm.c  
4. md file   at the same 
time.
2. In order to achieve the porting task , do I 
have to rewrite any source code file in GCC , or all I have to do is to handle 
the 
    four files above mentioned 
?

3. Suppose that I have a sample test program 
test.c     //test.c     
main()     {         
int  i;         
i=99;     }     Because I do not have a 
cross-assembler & a cross-linker,all I want to do     is 
porting GCC to make it compile test.c to generate test.s (source code 
    level ).       //test.s
      
...       ...       
ldc  99       
...       ...      I do not 
care the other directives in test.s as long as GCC can generate 
     the instruction " ldc  99 
".      
 
     Therefore, in order to 
achieve the task above mentioned . What files should      
I have to modify ? And how should I do it ? Could you please give me 
some      detailed steps or illustrations ? 
     (Host: 
i386-Linux , Build: 
i386-Linux,Target: javachip-none)
     Thanks anyway 
!!    
                                                                     
Edward< s892403@ccit.edu.tw >

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

* Re: A question about porting GCC to a javachip
  1998-12-18  0:18 A question about porting GCC to a javachip edward
@ 1998-12-21  6:03 ` Jeffrey A Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1998-12-21  6:03 UTC (permalink / raw)
  To: edward; +Cc: egcs

First note, you need to fix the date on your machine.  
  In message < 002701bdb225$74e2da00$0d25848c@pwf-9 >you write:
  > 1.In some porting reports , they indicate that it is easy to add a new =
  > machine description  to GCC --just add a few lines to =20
  >    "configure.in",but when I try to do it , I find that I have to create =
  > my javachip.h(tm.h) &javachip.c(tm.c)&javachip.md(.md
  >     file)first in order  to  avoid some unexpecting problems.Is it =
  > correct ?
When porting to a completely new architecture you will need to create new
files which describe the target machine.

  > 2. In order to achieve the porting task , do I have to rewrite any =
  > source code file in GCC , or all I have to do is to handle the=20
  >     four files above mentioned ?
Some ports require changing the target independent parts of the compiler,
some do not.  There is no simple answer to this question.


  > 3. Suppose that I have a sample test program test.c
[ ... ]
  >      Therefore, in order to achieve the task above mentioned . What =
  > files should
  >      I have to modify ?
The .c, .h & .md files you mentioned above.

  > And how should I do it ?
This is covered in the GCC manual.  I highly recommend you read the sections
which describe the RTL langauge, the target macros and the format of the
machine description file (the .md file).

jeff

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

* Re: A question about porting GCC to a javachip
@ 1998-12-18 14:27 Mike Stump
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Stump @ 1998-12-18 14:27 UTC (permalink / raw)
  To: egcs, s892403

> From: "edward" <s892403@ccit.edu.tw>
> Date: Sat, 18 Jul 1998 16:24:10 +0800

I don't like your mime formatting, nor the embedded html.

> Hi:
> 1.In some porting reports , they indicate that it is easy to add a new =
> machine description  to GCC --just add a few lines to =20
>    "configure.in",but when I try to do it , I find that I have to create =
> my javachip.h(tm.h) &javachip.c(tm.c)&javachip.md(.md
>     file)first in order  to  avoid some unexpecting problems.

Did you read the using and porting GNU CC manual?  If not, you should.
We require that you read it before we're likely to help you.  See
*.texi in the distribution.

> 2. In order to achieve the porting task , do I have to rewrite any =
> source code file in GCC , or all I have to do is to handle the=20
>     four files above mentioned ?

You may, if it was a normal port, then you should not need to, but if
the java chip isn't like a standard CPU then you will probably need
to.  Don't worry, the testsuite and debugging the problems found will
let you know when you need modify something.

>      Therefore, in order to achieve the task above mentioned . What =
> files should
>      I have to modify ? And how should I do it ? Could you please give =
> me some
>      detailed steps or illustrations ?=20

This is mostly beyond the scope of this list.  Please read and study
five ports (config/386/386.*, config/sparc/sparc.*, ...) and the
documentation, and you'll get a feel for what you need to do.  The
pick a port that most closely matches your chip, copy the files (ick,
I hate saying that), and now modify those parts that are different
from your chip.

Good luck

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

end of thread, other threads:[~1998-12-21  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-18  0:18 A question about porting GCC to a javachip edward
1998-12-21  6:03 ` Jeffrey A Law
1998-12-18 14:27 Mike Stump

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