Build gcc-7.2.0 gcc-7.2.0ビルド

I'll keep gcc to the latest version. gccを最新版にしておこう。 By the way, the current gcc version of debian jessie is 6.3.0. ちなみに、debian jessie の現在のgccのバージョンは6.3.0 である。

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

ここでは何もしない。

Build gcc-7.2.0 gcc-7.2.0ビルド

root@stretch:~# apt-get update
root@stretch:~# apt-get upgrade
root@stretch:~# uname -a
Linux stretch 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux
root@stretch:~# cat /etc/debian_version
9.3
root@stretch:~# gcc --version
gcc (Debian 6.3.0-18) 6.3.0 20170516
Copyright (C) 2016 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@stretch:~# wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz
root@stretch:~# tar xvf gcc-7.2.0.tar.xz
root@stretch:~# cd gcc-7.2.0
root@stretch:~/gcc-7.2.0# contrib/download_prerequisites
root@stretch:~/gcc-7.2.0# mkdir build
root@stretch:~/gcc-7.2.0# cd build
root@stretch:~/gcc-7.2.0/build# ../configure --prefix=/usr/local/gcc-7.2.0 --disable-multilib --enable-languages=c,c++
root@stretch:~/gcc-7.2.0/build# make -j 8
root@stretch:~/gcc-7.2.0/build# make check
root@stretch:~/gcc-7.2.0/build# make install
root@stretch:~/gcc-7.2.0/build# make clean
root@stretch:~/gcc-7.2.0/build# cd ../..

Version check and symbolic link create

バージョン確認とシンボリックリンク作成

root@stretch:~# /usr/local/gCC-7.2.0/bin/gCC --version
gcc-7.2.0 (GCC) 7.2.0
Copyright (C) 2017 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@stretch:~# ln -s /usr/local/gcc-7.2.0/bin/gcc /usr/local/bin/gcc-7.2.0
root@stretch:~# gcc-7.2.0 --version
gcc-7.2.0 (GCC) 7.2.0
Copyright (C) 2017 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.

*Annotation: /bin/gc c --> /bin/gcc(Half size). Somehow, an error occurs in PHP. *注: /bin/gc c --> /bin/gcc(半角). 何故か、PHPでエラーが起こる。

Operation check 動作確認

root@stretch:~# cat hello.c
#include    <stdio.h>

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

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

}

root@stretch:~# gcc-7.2.0 -ohello hello.c
root@stretch:~# ./hello
Hello gcc-7.2.0

T: Y: ALL: Online:
ThemeSwitch
  • Basic
Created in 0.0643 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