Re: [Tinycc-devel] tcc bootstrap
Hi, On Mon, 10 Mar 2014, Christian Jullien wrote: Yes I fully agree that tcc should, by default, be a gcc compiled program. Also, as Patrick said, having tcc bootstrapped by itself has the following advantages: - it proves tcc is complete - it proves tcc does not use gcc extensions, or it implements extensions in a compatible way - it is a very good non-regression test - it allows to have a decent C compiler without the need to install huge gcc suite (useful on ARM boards) A ./configure --bootstrap may do the job. Guys, just look at the testsuite. It's part of that since a long time. test3 compiles tcctest by a tcc compiled by tcc compiled by tcc compiled by tcc (i.e. _four_ times, the comment above it is wrong). Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
[Tinycc-devel] tcc bootstrap
Hi all, This is just a question I'm doing for myself. Currently, when you do a ./configure; make you generate a tcc that is a gcc compiled program implementing a tcc compiler. So far so good. The challenge for a compiler is to compile itself. Long ago, you were able to bootstrap gcc with any decent C compiler. The process was the following: - use alien C to produce a subset of gcc (xgcc if I recall well) - use xgcc to compile a first working gcc - use this interim gcc to produce final gcc. Now the questions: - Why tcc remains a gcc compiled code? - Corollary, can we use this tcc binary on a machine gcc free? - Do we want a tcc compiler compiled by tcc (an extra step can easily do that)? Ok, using gcc -O3 you can generate a tcc that compiles faster any program than tcc compiled with itself. Christian ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc bootstrap
On Sunday 09 March 2014 17:12:11 Christian Jullien wrote: Hi all, This is just a question I'm doing for myself. Currently, when you do a ./configure; make you generate a tcc that is a gcc compiled program implementing a tcc compiler. So far so good. The challenge for a compiler is to compile itself. Long ago, you were able to bootstrap gcc with any decent C compiler. The process was the following: - use alien C to produce a subset of gcc (xgcc if I recall well) - use xgcc to compile a first working gcc - use this interim gcc to produce final gcc. Now the questions: - Why tcc remains a gcc compiled code? Not sure if there's any deep reason behind it - * tcc started as a self-compiling demonstrator * most people don't care (and even gcc often isn't 'properly' bootstrapped) * in between (iirc before the 0.9.26 release) tcc was not well handled and unlearned to build itself. Mostly because of Makefile stupidity calling gcc directly and such funny things * recent tcc can self-compile properly - Corollary, can we use this tcc binary on a machine gcc free? That depends on if it links to the libgcc bits. I think that's a configure option? - Do we want a tcc compiler compiled by tcc (an extra step can easily do that)? Upside: It's a good demonstration that tcc is functional (especially if you do the classical triple bootstrap and run the testsuite) Downside: Increases compile time (up to ... almost 5 seconds! ;) ), adds more complexity to the Makefiles, ... Maybe it would be useful as a Makefile target? Ok, using gcc -O3 you can generate a tcc that compiles faster any program than tcc compiled with itself. That is mildly funny, but not unexpected ... Have fun, Patrick ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc bootstrap
Le 2014-03-10 07:27, Patrick Lauer a écrit : On Sunday 09 March 2014 17:12:11 Christian Jullien wrote: I think Patrick summarized things very well. Ok, using gcc -O3 you can generate a tcc that compiles faster any program than tcc compiled with itself. That is mildly funny, but not unexpected ... And I think that is the main reason why we don't compile tcc with tcc. I believe it's important to keep the possibility to demonstrate that tcc is capable enough to compile itself but I don't think we should do it by default. The most important use case for tcc is to use it for development because it's fast to compile programs. If tcc were to be compiled by itself it would be less fast (yet still quite fast) so there is not much interest in doing so. Best regards, Thomas P.S.: Hi Patrick :) ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc bootstrap
Hi Patrick and Thomas, Yes I fully agree that tcc should, by default, be a gcc compiled program. Also, as Patrick said, having tcc bootstrapped by itself has the following advantages: - it proves tcc is complete - it proves tcc does not use gcc extensions, or it implements extensions in a compatible way - it is a very good non-regression test - it allows to have a decent C compiler without the need to install huge gcc suite (useful on ARM boards) A ./configure --bootstrap may do the job. Christian -Original Message- From: tinycc-devel-bounces+eligis=orange...@nongnu.org [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Thomas Preudhomme Sent: lundi 10 mars 2014 02:19 To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] tcc bootstrap Le 2014-03-10 07:27, Patrick Lauer a écrit : On Sunday 09 March 2014 17:12:11 Christian Jullien wrote: I think Patrick summarized things very well. Ok, using gcc -O3 you can generate a tcc that compiles faster any program than tcc compiled with itself. That is mildly funny, but not unexpected ... And I think that is the main reason why we don't compile tcc with tcc. I believe it's important to keep the possibility to demonstrate that tcc is capable enough to compile itself but I don't think we should do it by default. The most important use case for tcc is to use it for development because it's fast to compile programs. If tcc were to be compiled by itself it would be less fast (yet still quite fast) so there is not much interest in doing so. Best regards, Thomas P.S.: Hi Patrick :) ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel