Sylvain Bertrand via llvm-dev
2016-Oct-17 11:02 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
Hi, The problem is modern c++. I can have a reasonable system boostrape-ed with (tinycc/alternative C compiler), but only in the gcc world since a modern c++ compiler is only bootsrape-able from near any C compiler there. clang and llvm are unable to do it. That why I would need to get 2 gccs: "any C compiler" -> gcc 4.7.4 -> gcc recent_version -> llvm. On Fri, Oct 14, 2016 at 4:02 PM, Renato Golin <renato.golin at linaro.org> wrote:> On 13 October 2016 at 12:56, <sylvain.bertrand at gmail.com> wrote: >> It's my custom distro. My goal is to make it boostrap-able with tinycc (or any >> little C compiler alternative) as a one-man reasonable job. With the removal of >> gcc 4.7 support now official, I would need to have a 3 step bootstrap, adding a >> modern gcc (which is guaranted to compile with iso c++98-ish gcc 4.7.4, feature >> that clang cannot guaranted anymore). > > Hi Sylvain, > > I have to say, after a while thinking about your use case, I cannot > come up with a better solution than a 3-stage build. :( > > Maybe you need to step back a bit and ask yourself: what would be the > system changes to adopt GCC 4.8 natively instead of tinycc. > > What distributions do is to compile the base GCC they'll use first, > making sure all the correct libraries in all the correct versions are > bundles in the right places, then use that toolchain for *everything*. > > You seem comfortable enough building GCC 4.7, I assume as a side > package, like BSD ports. I'm also assuming you already need GCC (for > packages other than LLVM), then why not make GCC your system compiler? > > The dependencies will already be there anyway, and I don't think GCC > 4.8's libraries are much bigger than 4.7, so it does seem like an > overall gain. > > Of course, it'll mean you'll have to test your packages with GCC 4.8, > but assuming they already use tinycc or GCC 4.7, I hope you'll have > very little additional problems. > > Would any of that help? > > cheers, > --renato
Renato Golin via llvm-dev
2016-Oct-17 14:17 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
On 17 October 2016 at 12:02, Sylvain Bertrand <sylvain.bertrand at gmail.com> wrote:> The problem is modern c++.I rather consider it a solution to the weirdness of C++98, but I see your point. :)> I can have a reasonable system boostrape-ed > with (tinycc/alternative C compiler), but only in the gcc world since > a modern c++ compiler is only bootsrape-able from near any C compiler > there. clang and llvm are unable to do it. That why I would need to > get 2 gccs: "any C compiler" -> gcc 4.7.4 -> gcc recent_version -> > llvm.I got it, and I understand your constraints. We have similar issues when building GCC from scratch. But for your distro, you only do that once per release, right? Once you have your system compiler, than shipping it as a binary package (or part of the base installation), should make it trivial to all users. Even if your system's package manager is port-based (like Gentoo/BSD/AUR), that you need to build packages from scratch, you'd still need the system compiler to be already installed, right? And I'm assuming that, once you picked a system compiler, you stay with it for at least a few months, which makes the 4-stage recompilation a pain, but not a critical issue. Or am I assuming too much? cheers, --renato
Bruce Hoult via llvm-dev
2016-Oct-17 14:24 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
I think this 3 stage bootstrap is just a fact of modern life, and progress of languages. In fact I think you're getting away lightly, and I'm amazed you could use only a 2-stage bootstrap from a very simple C compiler until now!! The good news: it should be a very very long time before you need a 4 stage bootstrap :-) On Mon, Oct 17, 2016 at 2:02 PM, Sylvain Bertrand via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > The problem is modern c++. I can have a reasonable system boostrape-ed > with (tinycc/alternative C compiler), but only in the gcc world since > a modern c++ compiler is only bootsrape-able from near any C compiler > there. clang and llvm are unable to do it. That why I would need to > get 2 gccs: "any C compiler" -> gcc 4.7.4 -> gcc recent_version -> > llvm. > > On Fri, Oct 14, 2016 at 4:02 PM, Renato Golin <renato.golin at linaro.org> > wrote: > > On 13 October 2016 at 12:56, <sylvain.bertrand at gmail.com> wrote: > >> It's my custom distro. My goal is to make it boostrap-able with tinycc > (or any > >> little C compiler alternative) as a one-man reasonable job. With the > removal of > >> gcc 4.7 support now official, I would need to have a 3 step bootstrap, > adding a > >> modern gcc (which is guaranted to compile with iso c++98-ish gcc 4.7.4, > feature > >> that clang cannot guaranted anymore). > > > > Hi Sylvain, > > > > I have to say, after a while thinking about your use case, I cannot > > come up with a better solution than a 3-stage build. :( > > > > Maybe you need to step back a bit and ask yourself: what would be the > > system changes to adopt GCC 4.8 natively instead of tinycc. > > > > What distributions do is to compile the base GCC they'll use first, > > making sure all the correct libraries in all the correct versions are > > bundles in the right places, then use that toolchain for *everything*. > > > > You seem comfortable enough building GCC 4.7, I assume as a side > > package, like BSD ports. I'm also assuming you already need GCC (for > > packages other than LLVM), then why not make GCC your system compiler? > > > > The dependencies will already be there anyway, and I don't think GCC > > 4.8's libraries are much bigger than 4.7, so it does seem like an > > overall gain. > > > > Of course, it'll mean you'll have to test your packages with GCC 4.8, > > but assuming they already use tinycc or GCC 4.7, I hope you'll have > > very little additional problems. > > > > Would any of that help? > > > > cheers, > > --renato > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161017/a61490a6/attachment.html>
Flamedoge via llvm-dev
2016-Oct-17 18:09 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
Just for the interest of discussion, I find it completely weird and interesting that GCC needs to build itself 3 times to fully bootstrap. Has there been any interest in looking at a single compile build? I don't exactly know the limitations, but my naive thinking is that C++14 compiler source parsed by C++14 capable compiler and codegen'd to C99 (or older) source should make it compilable by older compilers. Is this just a delusion or an actually useful idea? Regards, Kevin On Mon, Oct 17, 2016 at 7:24 AM, Bruce Hoult via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I think this 3 stage bootstrap is just a fact of modern life, and progress > of languages. In fact I think you're getting away lightly, and I'm amazed > you could use only a 2-stage bootstrap from a very simple C compiler until > now!! > > The good news: it should be a very very long time before you need a 4 > stage bootstrap :-) > > > On Mon, Oct 17, 2016 at 2:02 PM, Sylvain Bertrand via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hi, >> >> The problem is modern c++. I can have a reasonable system boostrape-ed >> with (tinycc/alternative C compiler), but only in the gcc world since >> a modern c++ compiler is only bootsrape-able from near any C compiler >> there. clang and llvm are unable to do it. That why I would need to >> get 2 gccs: "any C compiler" -> gcc 4.7.4 -> gcc recent_version -> >> llvm. >> >> On Fri, Oct 14, 2016 at 4:02 PM, Renato Golin <renato.golin at linaro.org> >> wrote: >> > On 13 October 2016 at 12:56, <sylvain.bertrand at gmail.com> wrote: >> >> It's my custom distro. My goal is to make it boostrap-able with tinycc >> (or any >> >> little C compiler alternative) as a one-man reasonable job. With the >> removal of >> >> gcc 4.7 support now official, I would need to have a 3 step bootstrap, >> adding a >> >> modern gcc (which is guaranted to compile with iso c++98-ish gcc >> 4.7.4, feature >> >> that clang cannot guaranted anymore). >> > >> > Hi Sylvain, >> > >> > I have to say, after a while thinking about your use case, I cannot >> > come up with a better solution than a 3-stage build. :( >> > >> > Maybe you need to step back a bit and ask yourself: what would be the >> > system changes to adopt GCC 4.8 natively instead of tinycc. >> > >> > What distributions do is to compile the base GCC they'll use first, >> > making sure all the correct libraries in all the correct versions are >> > bundles in the right places, then use that toolchain for *everything*. >> > >> > You seem comfortable enough building GCC 4.7, I assume as a side >> > package, like BSD ports. I'm also assuming you already need GCC (for >> > packages other than LLVM), then why not make GCC your system compiler? >> > >> > The dependencies will already be there anyway, and I don't think GCC >> > 4.8's libraries are much bigger than 4.7, so it does seem like an >> > overall gain. >> > >> > Of course, it'll mean you'll have to test your packages with GCC 4.8, >> > but assuming they already use tinycc or GCC 4.7, I hope you'll have >> > very little additional problems. >> > >> > Would any of that help? >> > >> > cheers, >> > --renato >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161017/b1ea3c52/attachment.html>
Michael Kruse via llvm-dev
2016-Oct-17 18:51 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
2016-10-17 13:02 GMT+02:00 Sylvain Bertrand via llvm-dev <llvm-dev at lists.llvm.org>:> The problem is modern c++. I can have a reasonable system boostrape-ed > with (tinycc/alternative C compiler), but only in the gcc world since > a modern c++ compiler is only bootsrape-able from near any C compiler > there. clang and llvm are unable to do it. That why I would need to > get 2 gccs: "any C compiler" -> gcc 4.7.4 -> gcc recent_version -> > llvm."any C compiler" must have been bootstrapped some way as well. The only compiler that doesn't need bootstrapping is one written in machine code. That is, one compiles a statically-linked version of gcc and copies it over to the new machine, assuming its ISA is backwards-compatible. If a modern compiler is required on the target machine, why not cross-compiling it? There is (or should) be no reason why another platform cannot generate the same binary result. Michael