Build gcc-11.2.0 gcc-11.2.0ビルド

I'll keep gcc to the latest version. gccを最新版にしておこう。

By the way, the current gcc version of debian bullseye is 10.2.1. ちなみに、debian bullseye の現在のgccのバージョンは10.2.1 である。

今回も gmp mpfr mpc を自動的にロードする

ここでは何もしない。

Build gcc-11.2.0 gcc-11.2.0ビルド


root@X240-i7:~# apt-get update
    :
root@X240-i7:~# apt-get upgrade
    :
root@X240-i7:~# uname -a
Linux X240-i7 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 GNU/Linux
root@X240-i7:~# cat /etc/debian_version
11.1
root@X240-i7:~# gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@X240-i7:~# wget https://bigsearcher.com/mirrors/gcc/releases/gcc-11.2.0/gcc-11.2.0.tar.xz
    :
root@X240-i7:~# tar xvf gcc-11.2.0.tar.xz
    :
root@X240-i7:~# cd gcc-11.2.0
root@X240-i7:~/gcc-11.2.0# contrib/download_prerequisites
    :
root@X240-i7:~/gcc-11.2.0# mkdir build
root@X240-i7:~/gcc-11.2.0# cd build
root@X240-i7:~/gcc-11.2.0/build# ../configure --prefix=/usr/local/gcc-11.2.0 --disable-multilib --enable-languages=c,c++
root@X240-i7:~/gcc-11.2.0/build# make -j 8
    :
root@X240-i7:~/gcc-11.2.0/build# make check
    : 
root@X240-i7:~/gcc-11.2.0/build# make install
    :
root@X240-i7:~/gcc-11.2.0/build# make clean
    :
root@X240-i7:~/gcc-11.2.0/build# cd ../..

Version check and symbolic link create
バージョン確認とシンボリックリンク作成


root@X240-i7:~# /usr/local/gcc-11.2.0/bin/gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@X240-i7:~# ln -s /usr/local/gcc-11.2.0/bin/gcc /usr/local/bin/gcc-11.2.0
root@X240-i7:~# gcc-11.2.0 --version
gcc-11.2.0 (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@X240-i7:~#

Operation check 動作確認


root@X240-i7:~# cat hello.c
#include    

int main (int argc,  char *argv[]) {

            printf("Hello gcc-%d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);

            return 0;
}

root@X240-i7:~# cc hello.c
root@X240-i7:~# ./a.out
Hello gcc-10.2.1
root@X240-i7:~# gcc-11.2.0 hello.c
root@X240-i7:~# ./a.out
Hello gcc-11.2.0
root@X240-i7:~#

T: Y: ALL: Online:
ThemeSwitch
  • Basic
Created in 0.0155 sec.
prev
2024.12
next
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 
strawberry-linux geigercounter Ver.2
Sibasaki, Cyofu City, Tokyo, JAPAN
blogBar