Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building GCC: What are the advantages and disadvantages of bootstrap?

Tags:

gcc

I understand what bootstrapping a compiler build does, but I don't understand the advantages and disadvantages for regular users. (I assume there is value for GCC maintainers.)

When configuring GCC, there are two options: --enable-bootstrap and --disable-bootstrap. As I understand, for vanilla compiler builds, --enable-bootstrap is enabled by default.

I cannot find anything on the advantages and disadvantages of using --disable-bootstrap. My Google-fu fails me. I assume the build will be faster, but what are the downsides?

To be clear, I am doing a vanilla x86-64 Linux GCC build from v6.1.0 official sources.

I ask because I see the option --disable-bootstrap used in the Linux from Scratch instructions here: http://www.linuxfromscratch.org/lfs/view/development/chapter06/gcc.html

like image 445
kevinarpe Avatar asked May 27 '16 01:05

kevinarpe


People also ask

Why Bootstrap is the best choice for web development?

Bootstrap is a well-structured library that the web developer can easily customize as he sees fit. A web application designed with Bootstrap is easy to maintain. Moreover, the source code of Bootstrap is a gold mine, an Ali Baba’s cave, where a web developer can learn development techniques.

What are the benefits of bootstrapping a business?

If you survive bootstrapping you will have a strong, lean, efficient, customer focussed company What are the disadvantages of bootstrapping? It is not always practical for businesses that need a large investment such as manufacturers or importers

Should --enable-bootstrap be enabled by default in GCC?

When configuring GCC, there are two options: --enable-bootstrap and --disable-bootstrap. As I understand, for vanilla compiler builds, --enable-bootstrap is enabled by default.

What are the disadvantages of --enable-bootstrap?

One disadvantage, although slight, is that --enable-bootstrap takes longer to compile. This is why I tend to pass --disable-bootstrap since compiling GCC already takes quite a long time, even if it is a very important program and one might be tempted to want to ensure it is "as correct as possible"..


1 Answers

The GCC configuration documentation says:

--disable-bootstrap
For a native build, the default configuration is to perform a 3-stage bootstrap of the compiler when ‘make’ is invoked, testing that GCC can compile itself correctly. If you want to disable this process, you can configure with --disable-bootstrap.

--enable-bootstrap
In special cases, you may want to perform a 3-stage build even if the target and host triplets are different. This is possible when the host can run code compiled for the target (e.g. host is i686-linux, target is i486-linux). Starting from GCC 4.2, to do this you have to configure explicitly with --enable-bootstrap.

On the whole, you're best off leaving this default well alone.

If you use --disable-bootstrap, it does a 1-stage build (per Explorer09 in a comment, but I've still not tried it), which could work when a 3-stage build won't.

If you need to know more, read the documentation.

like image 108
Jonathan Leffler Avatar answered Sep 29 '22 14:09

Jonathan Leffler