13,005
回編集
編集の要約なし |
|||
629行目: | 629行目: | ||
cd gcc-<バージョン> | cd gcc-<バージョン> | ||
<br> | <br> | ||
さらに、[https://sourceware.org/newlib/ | さらに、[https://sourceware.org/newlib/ Newlibの公式Webサイト]、または、[https://github.com/bminor/newlib/ NewlibのGithub]にアクセスして、Newlibのソースコードをダウンロードする。<br> | ||
もし、Newlibの公式Webサイトからファイルをダウンロードできない場合は、<code>wget</code>コマンド等を使用してダウンロードする。<br> | |||
wget ftp://sourceware.org/pub/newlib/newlib-<バージョン>.tar.gz | wget ftp://sourceware.org/pub/newlib/newlib-<バージョン>.tar.gz | ||
<br> | <br> | ||
<u>ただし、現在(2022年11月現在) | <u>ただし、現在(2022年11月現在)、Newlibの公式Webサイトからダウンロードしたファイルを使用するとビルドに失敗するため、Githubからダウンロードすること。</u><br> | ||
<br> | <br> | ||
ダウンロードしたファイルを解凍する。<br> | ダウンロードしたファイルを解凍する。<br> | ||
652行目: | 652行目: | ||
--disable-bootstrap --disable-nls --disable-werror --enable-lto --enable-gold \ | --disable-bootstrap --disable-nls --disable-werror --enable-lto --enable-gold \ | ||
--with-newlib \ | --with-newlib \ | ||
--with-headers=/< | --with-headers=/<上記でダウンロードしたNewlibのディレクトリ>/newlib/libc/include | ||
make -j $(nproc) | make -j $(nproc) | ||
make install | make install | ||
664行目: | 664行目: | ||
--disable-bootstrap --disable-nls --disable-shared --enable-static --enable-lto --enable-gold \ | --disable-bootstrap --disable-nls --disable-shared --enable-static --enable-lto --enable-gold \ | ||
--with-newlib \ | --with-newlib \ | ||
--with-headers=/< | --with-headers=/<上記でダウンロードしたNewlibのディレクトリ>/newlib/libc/include | ||
make -j $(nproc) | make -j $(nproc) | ||
make install | make install | ||
<br> | <br> | ||
次に、Newlibをビルドおよびインストールする。<br> | |||
mkdir build && cd build | mkdir build && cd build | ||
693行目: | 693行目: | ||
--disable-bootstrap --disable-nls --disable-shared --enable-static --disable-libstdc__-v3 --enable-lto --enable-gold \ | --disable-bootstrap --disable-nls --disable-shared --enable-static --disable-libstdc__-v3 --enable-lto --enable-gold \ | ||
--with-newlib \ | --with-newlib \ | ||
--with-headers=/< | --with-headers=/<上記でダウンロードしたNewlibのディレクトリ>/newlib/libc/include | ||
make -j $(nproc) | make -j $(nproc) | ||
make install | make install |