Building GCC 13.1 (and beyond) for C and C++

preview_player
Показать описание

►Lesson Description:
This is an updated video on how to build large source projects, specifically the gcc compiler for version 11. I build for the C, C++, and Dlang frontend programming languages and show you how to fix few dependencies errors and install the missing dependencies. In total, it took around 80 minutes for me to figure out how to build from scratch (including the time to compile the software from scratch).

Note: I probably should have run 'sudo make install' in order to creating the correct links to default to gcc-11 for instance.

00:00 Introduction
00:25 GCC 13 updates
02:40 Pre-requisites for installation
03:20 Checking your gcc version
04:19 Downloading GCC from git version control system
05:20 Setting up the source and build directory
07:37 Running configure
10:59 Building dependencies and some tips
12:13 Observing and running 'make' (About 35 minutes later)
13:24 Running make install
14:30 Running GCC 13 (I mean 14 experimental!)
15:30 Recap of the steps we ran
17:20 Wrap up and Conclusion

►Please like and subscribe to help the channel!
Рекомендации по теме
Комментарии
Автор

Hey Mike! Former student of yours here (CS5500 F23), just wanted to say thanks for these instructions! Used them to get gcc13 installed in WSL at work 👍

JohnOConnell-qb
Автор

Back in the day (in the 90s) I did a bootstrap installation of gcc on a microVAX running Ultrix32. Now *that* was an experience, all Ultrix32 had was a K&R C compiler, and somehow vi didn't want to recognize our original DEC VT102 terminal, so all I had to fix non-working stuff (because DEC's K&R C was not 100% K&R C, missing tools etc. pp.) had to be done in vi's so-called "open mode", which is basically ed with vi keybindings. You can try it with modern vi like eg. vim with ":open". Just remember ":visual" to regain your sanity :P
Oh, and it took *days*, not "half an hour". Remember, the microVAX was just 0.9 VUP (VAX unit of performance), with contemporary "big VAXen" having 2-3 per processor (and of course the microVAX only had one processor, unlike the bigger ones).
But anyway, I got it running, and that experience will stay with me forever!

hinzster
Автор

don't we need to make check after make -j?

ChaohuLightSunway
Автор

very nice, many thanks. One question, this build also provides libstdc++ and so on. However when using the binaries of the compiler of this build (and for example using them in a cmake project where cmake was instructed to these binaries it seems the linking is still done with the system versions installed (by inspecting ldd output), and not the brand new ones created ...
Any suggestions ?

lievendecock
Автор

hi, could you talk aout the something about the common bug: clang: error: linker command failed with exit code 1 (use -v to see invocation) ? It seems that it some times work and sometimes not

kafuu
Автор

Q5. Can you show me the contents of contrib directory.. I want to se if there is. Gmp resources there? I am facing the same problem with the gcc 12.0 instalation

fmm
Автор

Q2. Ubuntu 22.04.02 jammy jellyfish comes with a gcc compiler? If not why

fmm
Автор

Does it then use the new compiler to compile itself?? Or there will be no optimisations inside the binary of itself.

lolerie
Автор

Q1. In the prerequisite section you need some version of gcc to install some other version. What if u don't have any??

fmm
Автор

Hi Mike any suggestions for those who are learning c++20 modules on linux(vs code) ?

miguelx
Автор

Q4. You are cloning from git repository. Does this equally applicable to ftp server tarballs packages?

fmm
Автор

Q5. How to get build essential package offline

fmm
Автор

Hi!! any idea on how to make mingw for windows from linux. I did try out using "--host=x86_64-mingw32" but cant figure out the for windows

debankurdas
Автор

Q3. What's diff between gcc and gdc

fmm
Автор

Did someone also accidentally typed make in build dir instead of make -j [num] ....?

Leisery
Автор

Still no P1689R5🤦🏽‍♂️ [-fdep (module dependency scan)]

Oh, boy...

theintjengineer
Автор

Hi, thanks for the video but I get an error after "make -j 24" like this:

cc1plus: fatal error: gengtype-lex.cc: No such file or directory
compilation terminated.
make[3]: *** [Makefile:2977: build/gengtype-lex.o] Error 1
make[3]: *** Waiting for unfinished jobs....
echo timestamp > s-options
rm gfdl.pod gcc.pod gcov-dump.pod gcov-tool.pod fsf-funding.pod gpl.pod cpp.pod gcov.pod lto-dump.pod

Anyone else got the same error ? what is the solution here?
I have ubuntu 22.04

omerfaiq