Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Easy C compiler to port?

133 views
Skip to first unread message

Romesh Prakashpalan

unread,
Oct 10, 2002, 5:29:34 PM10/10/02
to
Hi guys!
I've gotten to the point of wanting to port a C compiler to my OS. I've
been using gcc under Windows to develop applications for the OS, but I'd
love to be able to compile/link/test under my own OS natively. I haven't
quite yet dwelved into the gcc source, but I fear for what lurks beneath.
Are there any other OpenSource C compilers that are out there? Does it just
use the C Standard Library? If that's the case, I have my own libc that I
could use...

Or for that matter, any other languages that would be fun to play with in an
easy to port package? Maybe something like FreePascal might be neat :-)

Thanks!
-Rom


Barry Watson

unread,
Oct 11, 2002, 5:18:03 AM10/11/02
to

Why do you have to port it? All you'll have to do is rewrite the
libraries.

David A. Caabeiro

unread,
Oct 11, 2002, 7:35:08 AM10/11/02
to
> Are there any other OpenSource C compilers that are out there? Does it
just
> use the C Standard Library? If that's the case, I have my own libc that I
> could use...

Check LCC

David.


David A. Caabeiro

unread,
Oct 11, 2002, 7:55:35 AM10/11/02
to
> Why do you have to port it? All you'll have to do is rewrite the
> libraries.

You can't run an executable from one OS into another, with
some exceptions...

Regards,
David.

Barry Watson

unread,
Oct 11, 2002, 9:12:05 AM10/11/02
to

cross compile the compiler with the rewritten libraries.

Marven Lee

unread,
Oct 11, 2002, 11:59:38 AM10/11/02
to

Barry Watson...
> David A. Caabeiro wrote...

> > You can't run an executable from one OS into another, with
> > some exceptions...
>
> cross compile the compiler with the rewritten libraries.

How much does the GCC source depend on Unix system calls
such as fork(), exec() or the the Unix filesystem calls?

Or does GCC for the most part use the plain vanilla standard
library functions?

Marv

Romesh Prakashpalan

unread,
Oct 11, 2002, 1:32:53 PM10/11/02
to
As I've said, I have the C Standard Library (libc), and my OS is not even
close to POSIX compliant. It's... different ;-)

I was wondering if gcc had any dependencies on other syscalls other than the
C standard library. If so, my job could become a nightmare depending on the
source.

Of course I could dwelve right into the source and find out, but I was
wondering if anyone had any experience with it.

Thanks for all the responses!
-Rom

"Barry Watson" <Barry....@uab.ericsson.se> wrote in message
news:3DA6974B...@uab.ericsson.se...

David A. Caabeiro

unread,
Oct 11, 2002, 7:19:07 PM10/11/02
to
> cross compile the compiler with the rewritten libraries.

Of course, if it's a retargetable compiler... which I guess
LCC is the easiest to try...

Regards,
David.

Jarek Pelczar

unread,
Oct 12, 2002, 1:00:17 PM10/12/02
to
Hi !

Try gcc 1.42 or gcc 1.40. They're quite good and easy to port.
I assume you have linux or DJGPP with GNU tools.
If you want underbars with symbols type run config.gcc shell script with
parameter i386g, but if you don't want them run it with i386v parameter.
Then type make and hope it worked. You will have gcc,cpp and cc1 (if you
compile under linux), for DOS you have to modify makefile ot compile it by
hand (the best way to do it in DOS. I've done it :).

Best regards
Jarek Pelczar
jar...@wp.pl

Paul Edwards

unread,
Oct 13, 2002, 7:26:11 AM10/13/02
to
"Marven Lee" <meh...@dsl.pipex.com> wrote in message news:ao6s72$jib83$1...@ID-141477.news.dfncis.de...

> How much does the GCC source depend on Unix system calls
> such as fork(), exec() or the the Unix filesystem calls?

Too much. There is no reason why something that could
clearly be a 100% ISO C program should be loaded with
calls to non-standard routines like open().

However, the use of fork/exec is isolated last time I looked,
and in fact, I did the sensible thing which is to create a
non-default compile option to convert gcc into one large
executable.

I also wrote unixio.c, which is in OZPD in the programming
section at www.kerravon.w3.to

> Or does GCC for the most part use the plain vanilla standard
> library functions?

I've never understood why people prefer to program in a
compiler instead of a language.

BFN. Paul.


0 new messages