in gccgo, go

It has been over a decade since the Go programming language has existed. With the course of time, it has established its presence in the software industry. Go 2 is also going to be released soon, with which many new additional features will be included in the language, such as generics.

The default compiler which is also known as gc that comes packaged with Go is certainly not as efficient as gccgo which is also a Go compiler but uses gcc backend to generate platform-dependent binaries.

So, if you want to use gccgo and somehow it is not available on your current Linux platform that you use then you can simply build it from source following the instructions below.

If you are on the Fedora platform than check whether the gccgo compiler is available in your package manager:

dnf info gcc-go

If you are prompted for installation then you saved yourself lots of hassle. You can skip the rest of this article. 😉

Preparation

First group install all the development tools:

dnf groupinstall "Development Tools"

After that choose the latest version of GCC source code from GNU’s official CDN site here. Then download it:

cd
wget https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz

Extract the downloaded file:

tar -xvzf gcc-10.2.0.tar.gz

Delete the downloaded file if you want to because we don’t need it now:

rm -rf gcc-10.2.0.tar.gz

Then, inside the extracted folder, download all the prerequisites:

cd gcc-10.2.0
./contrib/download_prerequisites

Build

Now create a folder named gccgo or something similar:

cd ../
mkdir gccgo
cd gccgo

In that folder, we need to configure the build process. So, if you need more customizations you can read the help doc like so:

../gcc-10.2.0/configure --help

We don’t need to specify values of the 3 switches: --build, --host, --target as they will be set automatically because you want to this compiler to execute and create binaries on the same machine you are building it. You can also specify a custom installation directory with --prefix whose default value is /usr/local/bin

Also, make sure that you use the “gold” link editor or linker. If you don’t know where it is located than below cmd will print its path:

find / -name ld.gold

In the end your settings should look something like this:

../gcc-10.2.0/configure --disable-shared --enable-languages=go --disable-multilib --with-ld=/usr/bin/ld.gold --enable-gold=yes

Which will create a makefile in your current directory and then you need to simply execute:

make

This will take about 2 to 3 hours depending on your machine. So sit back, sip a cup of tea ☕ and relax. 😉

Install

After completion, install the gccgo

make install

Then check the version:

gccgo -v

Which will print the gcc version:

Using built-in specs.
COLLECT_GCC=gccgo
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-10.2.0/configure --enable-shared --enable-languages=go --disable-multilib --with-ld=/usr/bin/ld.gold --enable-gold=yes
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)

Now you can use gccgo to compile your Go application or programs. For instance, let’s write a classic Hello World program in a file hello.go to test the compiler:

nano hello.go
package main

import "fmt"

func main() {
    fmt.Println("Hello, world!");
    fmt.Println("नमस्ते, संसार।");
}

After that compile using gccgo

gccgo hello.go -o hello

Then execute out program to get the output

./hello
Hello, world!
नमस्ते, संसार।

Alternatively, you can also use go cmd to compile and execute the program. It will also produce the same result:

go run hello.go

18 Comments

  1. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to read? Damara Even Means

  2. You are so cool! I don’t suppose I have read anything like that
    before. So wonderful to find another person with genuine thoughts on this topic.
    Seriously.. many thanks for starting this up. This website is something that is needed on the internet, someone with a bit of originality!

  3. Terrific article! That is the kind of info that are supposed to be shared around the internet.

    Shame on the seek engines for now not positioning this post upper!
    Come on over and consult with my site . Thank you =)

  4. You actually make it seem so easy with your presentation but I find this topic to be actually something which I think I would
    never understand. It seems too complicated and very broad for me.
    I’m looking forward for your next post, I will try to get the hang of it!

  5. My spouse and I absolutely love your blog and find a lot of your post’s
    to be exactly what I’m looking for. Do you offer guest writers to write content in your case?

    I wouldn’t mind composing a post or elaborating
    on a number of the subjects you write in relation to here.
    Again, awesome web log!

    Also visit my homepage CBD for dogs

  6. I have been browsing online more than 4 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you did, the internet will be much more useful than ever before.| Benita Dicky Thorne

  7. An impressive share! I have just forwarded this onto a friend who has been doing a little research on this.
    And he actually ordered me dinner simply because
    I stumbled upon it for him… lol. So let me reword this….
    Thank YOU for the meal!! But yeah, thanks for spending
    time to talk about this issue here on your website.

    Feel free to surf to my blog post CBD gummies for pain

Webmentions

  • gas fireplace March 22, 2021

    gas fireplace

    […]just beneath, are several totally not connected web sites to ours, nevertheless, they may be certainly really worth going over[…]

  • bàn học cho bé March 22, 2021

    bàn học cho bé

    […]we came across a cool site that you just may enjoy. Take a appear if you want[…]

  • viagra from canada March 22, 2021

    viagra from canada

    How to build gccgo from source? | Harsh Rathod

  • Pistol Sights March 22, 2021

    Pistol Sights

    […]although internet sites we backlink to below are considerably not connected to ours, we really feel they are in fact worth a go by, so have a look[…]

  • best female sex toys March 22, 2021

    best female sex toys

    […]Wonderful story, reckoned we could combine a number of unrelated data, nonetheless actually worth taking a search, whoa did a single study about Mid East has got extra problerms too […]

  • their website March 22, 2021

    their website

    […]The details talked about inside the write-up are a number of the best out there […]

  • someone you know on tinder March 22, 2021

    someone you know on tinder

    How to build gccgo from source? | Harsh Rathod

  • learn more March 22, 2021

    learn more

    […]just beneath, are quite a few completely not connected websites to ours, however, they’re certainly really worth going over[…]

  • Buy Ritalin 10mg Online March 22, 2021

    Buy Ritalin 10mg Online

    […]here are some links to web-sites that we link to because we feel they’re worth visiting[…]

  • buy guitar hero arcade March 22, 2021

    buy guitar hero arcade

    […]The info mentioned in the post are several of the top obtainable […]

  • SEO Agency March 22, 2021

    SEO Agency

    […]although web-sites we backlink to beneath are considerably not related to ours, we feel they’re basically worth a go by, so have a look[…]

  • bitcoin in vancouver March 22, 2021

    bitcoin in vancouver

    […]Sites of interest we have a link to[…]

  • in canada March 22, 2021

    in canada

    […]Every when inside a while we opt for blogs that we read. Listed beneath would be the newest web sites that we decide on […]

  • CRUISE March 22, 2021

    CRUISE

    […]very couple of websites that take place to be detailed beneath, from our point of view are undoubtedly very well really worth checking out[…]

  • best sex games March 22, 2021

    best sex games

    […]we like to honor many other internet internet sites around the net, even when they aren’t linked to us, by linking to them. Underneath are some webpages really worth checking out[…]

  • best strap on dildos March 22, 2021

    best strap on dildos

    […]Wonderful story, reckoned we could combine several unrelated information, nevertheless definitely worth taking a look, whoa did one particular master about Mid East has got a lot more problerms also […]

  • موقع سكس March 22, 2021

    موقع سكس

    […]Here are a few of the web sites we suggest for our visitors[…]

  • learn more March 22, 2021

    learn more

    […]Sites of interest we’ve a link to[…]

  • Lehitravel.com March 22, 2021

    Lehitravel.com

    […]we prefer to honor a lot of other world-wide-web web sites on the net, even if they aren’t linked to us, by linking to them. Under are some webpages really worth checking out[…]

  • CLUB CANNA VAPE PEN March 22, 2021

    CLUB CANNA VAPE PEN

    […]we came across a cool internet site that you simply may well delight in. Take a appear for those who want[…]

  • vibrating panty March 22, 2021

    vibrating panty

    […]Here are some of the websites we advocate for our visitors[…]

  • SEO Nanaimo March 22, 2021

    SEO Nanaimo

    […]always a huge fan of linking to bloggers that I really like but really don’t get quite a bit of link really like from[…]

  • movers near me March 22, 2021

    movers near me

    […]we prefer to honor a lot of other web internet sites on the web, even if they aren’t linked to us, by linking to them. Beneath are some webpages worth checking out[…]

  • www.meetfreegirls.info/crossdress-cams March 22, 2021

    http://www.meetfreegirls.info/crossdress-cams

    […]please visit the websites we comply with, which includes this 1, as it represents our picks through the web[…]

  • minecraft code March 22, 2021

    minecraft code

    […]one of our visitors lately encouraged the following website[…]

  • Buy Dexedrine online without prescription March 22, 2021

    Buy Dexedrine online without prescription

    […]that would be the finish of this post. Right here you’ll discover some websites that we believe you’ll enjoy, just click the hyperlinks over[…]

  • buy dexdrine online usa March 22, 2021

    buy dexdrine online usa

    […]that may be the end of this report. Here you will find some internet sites that we believe you’ll value, just click the links over[…]

  • yamaha r3 March 22, 2021

    yamaha r3

    […]very few websites that occur to become comprehensive beneath, from our point of view are undoubtedly nicely really worth checking out[…]

  • Black Latex Gloves March 22, 2021

    Black Latex Gloves

    […]Wonderful story, reckoned we could combine a few unrelated data, nevertheless really really worth taking a appear, whoa did one particular master about Mid East has got more problerms at the same time […]

  • counterfeit money for sale March 22, 2021

    counterfeit money for sale

    […]Here are a number of the web pages we advocate for our visitors[…]

  • online cbd shop March 22, 2021

    online cbd shop

    […]the time to study or take a look at the material or websites we have linked to below the[…]

  • Latex Gloves March 22, 2021

    Latex Gloves

    […]The data mentioned within the report are a few of the most beneficial out there […]

  • shipping containers for sale near me March 22, 2021

    shipping containers for sale near me

    […]very few internet websites that transpire to be comprehensive beneath, from our point of view are undoubtedly effectively really worth checking out[…]

  • Buy lsd gel tabs with PayPal online March 22, 2021

    Buy lsd gel tabs with PayPal online

    […]although websites we backlink to beneath are considerably not related to ours, we really feel they’re in fact worth a go by way of, so possess a look[…]

  • THC Oil for Sale March 22, 2021

    THC Oil for Sale

    […]we came across a cool web-site that you simply may love. Take a appear for those who want[…]

  • Containers for sale March 22, 2021

    Containers for sale

    […]Here is a superb Blog You may Come across Fascinating that we Encourage You[…]

  • SEO Services Zimbabwe March 22, 2021

    SEO Services Zimbabwe

    […]we came across a cool web-site that you may well love. Take a search when you want[…]

  • Guns for sale March 22, 2021

    Guns for sale

    […]just beneath, are several entirely not connected internet sites to ours, nonetheless, they are surely really worth going over[…]

  • End Of Tenancy Cleaning Canning Town March 22, 2021

    End Of Tenancy Cleaning Canning Town

    […]usually posts some extremely fascinating stuff like this. If you are new to this site[…]

  • Commercial End Of Tenancy Cleaning UK March 22, 2021

    Commercial End Of Tenancy Cleaning UK

    […]although websites we backlink to below are considerably not related to ours, we really feel they may be essentially really worth a go by way of, so possess a look[…]

  • order guns online March 22, 2021

    order guns online

    […]below you’ll find the link to some sites that we think you’ll want to visit[…]

  • siamese kittens for sale near me March 22, 2021

    siamese kittens for sale near me

    […]Wonderful story, reckoned we could combine several unrelated information, nonetheless seriously really worth taking a look, whoa did 1 understand about Mid East has got extra problerms also […]

  • sig p365 sas March 22, 2021

    sig p365 sas

    […]Here is a great Blog You may Come across Interesting that we Encourage You[…]

  • mimosa hostilis March 22, 2021

    mimosa hostilis

    […]check below, are some totally unrelated internet websites to ours, having said that, they’re most trustworthy sources that we use[…]

  • Vidalista 20mg March 22, 2021

    Vidalista 20mg

    […]Here are some of the web pages we recommend for our visitors[…]

  • cryptocurrency March 22, 2021

    cryptocurrency

    […]here are some hyperlinks to sites that we link to since we feel they are worth visiting[…]

  • 코인카지노 March 22, 2021

    코인카지노

    […]Here are some of the internet sites we recommend for our visitors[…]

  • 메리트카지노 March 22, 2021

    메리트카지노

    […]here are some links to web pages that we link to mainly because we believe they may be worth visiting[…]

  • 퍼스트카지노 March 22, 2021

    퍼스트카지노

    […]Here are several of the websites we suggest for our visitors[…]

  • 우리카지노 March 22, 2021

    우리카지노

    […]Wonderful story, reckoned we could combine some unrelated information, nonetheless actually worth taking a appear, whoa did one particular understand about Mid East has got a lot more problerms also […]

  • 샌즈카지노 March 22, 2021

    샌즈카지노

    […]we prefer to honor numerous other internet web pages around the web, even when they aren’t linked to us, by linking to them. Below are some webpages worth checking out[…]

  • Google March 22, 2021

    Google

    Just beneath, are several absolutely not connected web-sites to ours, having said that, they are surely worth going over.

  • Google March 22, 2021

    Google

    Sites of interest we have a link to.