LoginSignup
0
2

More than 5 years have passed since last update.

RaspberryPi2 CentOS7でgcc-4.9.4 のビルドがうまくいかない→できました!

Last updated at Posted at 2017-08-28

環境

raspberry pi2 on centos7

# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
Linux version 4.4.26-v7.1.el7 (mockbuild@armv7-02.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Sat Oct 22 16:14:43 UTC 2016

cpuinfo: ARMv7 Processor rev 5 (v7l)

makeで標準出力の末尾に以下のメッセージが出力される

In file included from /usr/include/features.h:399:0,
from /usr/include/stdio.h:27,
from ../../../libgcc/../gcc/tsystem.h:87,
from ../../../libgcc/libgcc2.c:27:
/usr/include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory
# include
^
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory /tmp/gcc-4.9.4/build/armv7l-unknown-linux-gnueabihf/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory
/tmp/gcc-4.9.4/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory /tmp/gcc-4.9.4/build'
make: *** [all] Error 2
``

原因

調査中・・・
何かご存じの方いらっしゃいましたら、コメントまでお願いできますでしょうか。

2017/09/25追記

gnu/stubs-soft.hを他のマシンから持ってきたり、glibcをupdateしてみたり、コンパイルオプションに
--mfloat-abi=hardを追加してみましたが、だめでした。
このまま暗礁に乗り上げそうです。

2018/11/15追記

--disable-multilib --with-float=hard をオプションにつけたところ、正常にビルドすることが出来ました。
実際のコマンド:
./configure --prefix=/usr/local/gcc-4.9.4 --disable-multilib --with-float=hard
make
make install

# gcc -v
組み込み spec を使用しています。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.9.4/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.9.4/lto-wrapper
ターゲット: armv7l-unknown-linux-gnueabihf
configure 設定: ../configure --prefix=/usr/local/gcc-4.9.4 --disable-multilib --with-float=hard
スレッドモデル: posix
gcc バージョン 4.9.4 (GCC)

RaspberryPi2でのmakeには丸1日かかりましたので、止めたくないサービスがある場合は留意したほうがよさそうです。

コメントしてくださったみなさま、ありがとうございました。

0
2
8

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
0
2