[Steven Woody] M16C development using GCC, Is It Possible?

2005-10-26 Thread Steven Woody

i am currently working on a project of building M16C programs. i have an IRA
M16C/I8C C/C++ compiler on hand, but it is for Windows and i just can not live
w/o my Linux box. another reason i have to use GCC is that i must use some unit
test tools which ask for gcc.

i heard that gcc is also a cross-compiler, so i want to get know if it can
be used as an M16C compiler? in GCC's home page, there is one item:

'July 20, 2005
Red Hat Inc has contributed a port for the Renesas R8C/M16C/M32C families'

what that really means?  and in this page
'http://a15177702.alturo-server.de/gcc-m16c/20050419.html', it said, GCC
M16C project is totally bugy.

so, what's the fact and what's your suggestion? (BTW: i need compile C++ not C
only)

thanks!

-- 
steven woody (id: narke)



Re: [Steven Woody] M16C development using GCC, Is It Possible?

2005-10-27 Thread Steven Woody
DJ Delorie <[EMAIL PROTECTED]> writes:

>> i heard that gcc is also a cross-compiler, so i want to get know if
>> it can be used as an M16C compiler?
>
> Yes.  The target you want to use to build gcc et al is "m32c-elf".
>
> To compile for the m16c specifically, use "m32c-elf-gcc -mcpu=m16c ..."

thanks. is that a 4.02 option? i can not find them on my 3.4 gcc man page.

>
>> in GCC's home page, there is one item:
>>
>> 'July 20, 2005
>> Red Hat Inc has contributed a port for the Renesas R8C/M16C/M32C 
>> families'
>> 
>> what that really means?
>
> It means that Red Hat Inc has modified gcc (and binutils and newlib)
> to support the r8c/m16c/m32c family of processors from Renesas, and
> given those changes to the FSF to be integrated into their official
> sources.

how it going on? have it been alreay available in 4.02?

>
> gdb and a simulator are still in progress.

that seem ok since i currently only need gcc. and, because i am new to the
field , i want to ask, what is a 'simulator'? run target excutable on host
computer?


>> and in this page
>> 'http://a15177702.alturo-server.de/gcc-m16c/20050419.html', it said, GCC
>> M16C project is totally bugy.
>
> That's a different attempt to port gcc to m16c, and has nothing to do
> with what I did.

sorry, are you the author of the new m16c/gcc code? i noticed your domain name
is redhat.

>
>> (BTW: i need compile C++ not C only)
>
> Note that I haven't gotten around to supporting C++ yet.  You can try
> to build it if you want, but I had deferred it due to other more
> important issues, and haven't had a chance to work on it.  It might
> "just work", you never know ;-)

do you mean, the current m16c/gcc code never compiler c++ code? if so, that is
definitely a bad news to me, since our project based on EC++ (Embedded
C++). though you pointed that i could build for my self, but in fact i can not,
i know nothing about compiler writing :(

so, i am thinking another question. if i can write the code which can pass both
the current (3.4) g++ compiler and the IAR M16C C++ compiler, so my problem
will resolved. but is it possible of the idea? i think i can use some #ifdef
statements and move any IO into stubs. how different are these two compilers
in C++ syntax?

i like to heard any suggestion, and thank you in advance.


-- 
steven woody (id: narke)

Pepper...is hot and scorches, just like the sun

- Politiki kouzina (2003)



Re: [Steven Woody] M16C development using GCC, Is It Possible?

2005-10-28 Thread Steven Woody
DJ Delorie <[EMAIL PROTECTED]> writes:

>> > To compile for the m16c specifically, use "m32c-elf-gcc -mcpu=m16c ..."
>> 
>> thanks. is that a 4.02 option? i can not find them on my 3.4 gcc man page.
>
> The r8c/m16c/m32c port is new.  Currently, it's only in the mainline
> CVS sources, and will be "officially" released in the gcc 4.1 series.
>
>> > gdb and a simulator are still in progress.
>> 
>> that seem ok since i currently only need gcc.
>
> You'll need binutils also, at least, and probably newlib to get crt0
> and some sample libraries and linker scripts.

where to get the binutils and other stuff you mentioned? are they included in
current CVS?

>
>> and, because i am new to the field , i want to ask, what is a
>> 'simulator'? run target excutable on host computer?
>
> Yes.
>
>> > That's a different attempt to port gcc to m16c, and has nothing to do
>> > with what I did.
>> 
>> sorry, are you the author of the new m16c/gcc code? i noticed your
>> domain name is redhat.
>
> I am one of the authors, and the current maintainer.
>
>> do you mean, the current m16c/gcc code never compiler c++ code?
>
> No, it just means I haven't tried it recently.  It mostly worked back
> when I was working in that area, but "mostly" wasn't good enough for
> what I was doing, so I just skipped it, as I didn't need C++ back
> then.

might there is anyone else tried it. but i think i will be the one ...

>
>> C++). though you pointed that i could build for my self, but in fact
>> i can not, i know nothing about compiler writing :(
>
> Compiler building, not compiler writing.  I already did the writing part.
>
>> so, i am thinking another question. if i can write the code which
>> can pass both the current (3.4) g++ compiler and the IAR M16C C++
>> compiler, so my problem will resolved. but is it possible of the
>> idea? i think i can use some #ifdef statements and move any IO into
>> stubs. how different are these two compilers in C++ syntax?
>

> The pragmas for assigning addresses to I/O variables are different,
> but it's only a header change to get them working with gcc.  Note that

okay, it's a good news.

> g++'s C++ is much more strict and current than most other C++
> compilers; it's likely you'll have to fix your code to get it to work,
> but this would be due to code bugs and not g++ bugs if so.

i plan to write in g++ from scratch. so its strictness is a good news and it
will make life easy when i later compile on IAR's compiler, do i rightly 
understand?

-- 
steven woody (id: narke)

How Far You Fall Doesn't Matter, It's How You Land

- Haine, La (1995)



Re: [Steven Woody] M16C development using GCC, Is It Possible?

2005-10-28 Thread Steven Woody
DJ Delorie <[EMAIL PROTECTED]> writes:

>> where to get the binutils and other stuff you mentioned? are they included in
>> current CVS?
>
> http://sources.redhat.com/binutils/
> http://sources.redhat.com/newlib/
>
> Again, in both cases you'll need to use the CVS version as the m32c
> port is still new enough that it hasn't shown up in any official
> releases yet.
>
>> i plan to write in g++ from scratch. so its strictness is a good
>> news and it will make life easy when i later compile on IAR's
>> compiler, do i rightly understand?
>
> Yes, unless their implementation is old enough to be incompatible.
>

ok, thanks for your help. now i know what i need to do is to get latest cvs
code from GNU for 'gcc', 'binutils' and 'newlib', then compile and install
them, right?  

after it were done, i will get capabilities of compile/linker from c++ source
to M16C executable on my Linux host computer and the special capabilities come
from giving extra options to gcc/ld/as command and these commands will keep no
change when i use them normally and produce native code, right?

sorry for bother.

-- 
steven woody (id: narke)

Charles: Let me ask you one thing. Do you think - after we've dried
off, after we've spent lots more time together - you might agree *not*
to marry me? And do you think not being married to me might maybe be
something you could consider doing for the rest of your life?  
Carrie: I do.

- Four Weddings and a Funeral (1994)



How Can I Get See A Memory Map For An Executable

2005-11-12 Thread Steven Woody

i want to check in my C++ program, what variable is allocated in where. is
there such a tool?

another relative question is, where the 'new' operator get memory from? the
global heap? does it same with what 'malloc' get from?

thanks.


-- 
steven woody (id: narke)

Celine: Well, who says relationships have to last forever? 

- Before Sunrise (1995)



Runtime Memory Usage Graph

2005-11-12 Thread Steven Woody
how can i get see the runtime memory useage graph for my c++ program? this will
include stack memory and dynamic memory (heap). thanks.

-
narke



How Can I Get See A Memory Map For An Executable

2005-11-13 Thread Steven Woody

i want to check in my C++ program, what variable is allocated in where. is
there such a tool?

another relative question is, where the 'new' operator get memory from? the
global heap? does it same with what 'malloc' get from?

thanks.


-- 
steven woody (id: narke)

Celine: Well, who says relationships have to last forever? 

- Before Sunrise (1995)