Installing GCC (12.2) in Ubuntu 22.04 from scratch.

preview_player
Показать описание
GCC is a generic compiler which supports a lot of languages. Most commonly GCC is used for C, C++.

sudo apt install build-essential htop gcc-multilib zlib1g-dev

./contrib/download_prerequisites

./configure -v --with-pkgversion='Ubuntu 12.2.0-1ubuntu1~22.04' --enable-languages=c,c++,objc,obj-c++ --prefix=$HOME/gcc --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=$HOME/gcc/usr/lib --without-included-gettext --enable-threads=posix --libdir=$HOME/gcc/usr/lib --enable-nls --disable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2

make -j $(nproc --all)

make install
Рекомендации по теме
Комментарии
Автор

Will this work on host machine Macbook Air M1, using Virtual machine Ubuntu Linux?

jadeaustin
Автор

did anyone run ls -/gcc and could't get past that due to an error?

abdukiys
Автор

Will it update the original gcc version used by ubuntu ?
sudo apt install build-essential htop gcc-multilib zlib1g-dev

mdziaurrahman