Build gcc-9.2.0 gcc-9.2.0ビルド
I'll keep gcc to the latest version. gccを最新版にしておこう。 By the way, the current gcc version of debian buster is 8.3.0. ちなみに、debian buster の現在のgccのバージョンは8.3.0 である。今回も gmp mpfr mpc を自動的にロードする
ここでは何もしない。Build gcc-9.2.0 gcc-9.2.0ビルド
root@X240-i7:~# apt-get update : root@X240-i7:~# apt-get upgrade : root@X240-i7:~# uname -a Linux X240-i7 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 GNU/Linux root@X240-i7:~# cat /etc/debian_version 10.3 root@X240-i7:~# gcc --version gcc (Debian 8.3.0-6) 8.3.0 Copyright (C) 2018 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 http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.2.0/gcc-9.2.0.tar.xz --2020-02-10 16:03:02-- http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.2.0/gcc-9.2.0.tar.xz Resolving ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)... 203.178.132.80, 2001:200:0:7c06::9393 Connecting to ftp.tsukuba.wide.ad.jp (ftp.tsukuba.wide.ad.jp)|203.178.132.80|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 70607648 (67M) [application/x-xz] Saving to: 'gcc-9.2.0.tar.xz' gcc-9.2.0.tar.xz 100%[=================================================>] 67.34M 6.61MB/s in 13s 2020-02-10 16:03:16 (5.19 MB/s) - 'gcc-9.2.0.tar.xz' saved [70607648/70607648] root@X240-i7:~# tar xvf gcc-9.2.0.tar.xz : root@X240-i7:~# cd gcc-9.2.0 root@X240-i7:~/gcc-9.2.0# contrib/download_prerequisites 2020-02-10 15:19:47 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 [2383840] -> "./gmp-6.1.0.tar.bz2" [1] 2020-02-10 15:19:52 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 [1279284] -> "./mpfr-3.1.4.tar.bz2" [1] 2020-02-10 15:19:56 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz [669925] -> "./mpc-1.0.3.tar.gz" [1] 2020-02-10 15:20:01 URL: ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 [1658291] -> "./isl-0.18.tar.bz2" [1] gmp-6.1.0.tar.bz2: OK mpfr-3.1.4.tar.bz2: OK mpc-1.0.3.tar.gz: OK isl-0.18.tar.bz2: OK All prerequisites downloaded successfully. root@X240-i7:~/gcc-9.2.0# mkdir build root@X240-i7:~/gcc-9.2.0# cd build root@X240-i7:~/gcc-9.2.0/build# ../configure --prefix=/usr/local/gcc-9.2.0 --disable-multilib --enable-languages=c,c++ root@X240-i7:~/gcc-9.2.0/build# make -j 8 : root@X240-i7:~/gcc-9.2.0/build# make check : 注:なぜかエラーになる。気にしない気にしない。 root@X240-i7:~/gcc-9.2.0/build# make install : root@X240-i7:~/gcc-9.2.0/build# make clean : root@X240-i7:~/gcc-9.2.0/build# cd ../..
Version check and symbolic link create
バージョン確認とシンボリックリンク作成
root@X240-i7:~# /usr/local/gcc-9.2.0/bin/gcc --version gcc (GCC) 9.2.0 Copyright (C) 2019 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-9.2.0/bin/gcc /usr/local/bin/gcc-9.2.0 root@X240-i7:~# gcc-9.2.0 --version gcc-9.2.0 (GCC) 9.2.0 Copyright (C) 2019 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 #includeint 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-8.3.0 root@X240-i7:~# gcc-9.2.0 hello.c root@X240-i7:~# ./a.out Hello gcc-9.2.0 root@X240-i7:~#
T: Y: ALL: Online:
ThemeSwitch
- Basic
Created in 0.0180 sec.
Comments