1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GCC 9.3.0をソースコードからビルドする

Last updated at Posted at 2020-04-01

GCCを自分でビルドしてみたい時に読んでください。

ソースコードをダウンロード && 展開

wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.xz
tar xf gcc-9.3.0.tar.xz

ビルド・インストールディレクトリを作成

build : ビルドに使用するディレクトリ
install : 現在ディレクトリ直下にinstallを作成し、そこにインストールする。他にインストール場合は任意のものに変える

mkdir build install

プレビルド

GCCのビルドに必要なパッケージを取得する

pushd gcc-9.3.0
./contrib/download_prerequisites
popd

ビルド

pushd build
../gcc-9.3.0/configure --prefix=./install \
                       --enable-languages=c,c++,fortran \
                       --disable-multilib \
                       --disable-bootstrap
make
make install
popd

makeする部分はお好みでmake -j4のようにすると4プロセス並列ビルドする。筆者はVMでやっているためメモリ不足が怖くて並列ビルドはしていない。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?