GCC 5.1.0は、LFSの指示に従ってコンパイルできません。 - 接続エラーが発生しましたか?

GCC 5.1.0は、LFSの指示に従ってコンパイルできません。 - 接続エラーが発生しましたか?

LFSガイドに従ってbinutils 5.25とglibc 2.21を使用してGCC 5.1をコンパイルしようとしましたが、「gcc pass 2」ステップに達するとエラーでプロセスが失敗しました。

ld: /tools/lib/../lib64/libstdc++.a(new_opv.o): relocation R_X86_64_32 against `_ZTISt9bad_alloc' can not be used when making a shared object; recompile with -fPIC
/tools/lib/../lib64/libstdc++.a: error adding symbols: Bad value

そのオプションを提供しようとしましたが、-fPIC役に立ちません。

私の設定オプションは次のとおりです。

CC=$LFS_TGT-gcc
CXX=$LFS_TGT-g++
AR=$LFS_TGT-ar
RANLIB=$LFS_TGT-ranlib
../gcc-5.1.0/configure \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp

完全なエラーメッセージは次のとおりです。

libtool: link: x86_64-peal-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /home/system/peal/system/system/toolchain/tools/lib/../lib64/crti.o /home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/crtbeginS.o  .libs/findcomp.o .libs/libcc1.o .libs/names.o .libs/callbacks.o .libs/connection.o .libs/marshall.o   -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0 -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc -L/home/system/peal/system/system/toolchain/tools/lib/../lib64 -L/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/../../../../x86_64-peal-linux-gnu/lib -L/home/system/peal/system/system/toolchain/tools/lib /tools/lib/../lib64/libstdc++.a -lm -lc -lgcc /home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/crtendS.o /home/system/peal/system/system/toolchain/tools/lib/../lib64/crtn.o  -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,libcc1.so.0 -Wl,-retain-symbols-file -Wl,../../gcc-5.1.0/libcc1/libcc1.sym -o .libs/libcc1.so.0.0.0
/home/system/peal/system/system/toolchain/tools/bin/../lib/gcc/x86_64-peal-linux-gnu/5.1.0/../../../../x86_64-peal-linux-gnu/bin/ld: /tools/lib/../lib64/libstdc++.a(new_opv.o): relocation R_X86_64_32 against `_ZTISt9bad_alloc' can not be used when making a shared object; recompile with -fPIC
/tools/lib/../lib64/libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:409: recipe for target 'libcc1.la' failed
make[3]: *** [libcc1.la] Error 1
make[3]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build/libcc1'
Makefile:291: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build/libcc1'
Makefile:10639: recipe for target 'all-libcc1' failed
make[1]: *** [all-libcc1] Error 2
make[1]: Leaving directory '/home/system/peal/system/system/toolchain/sources/gcc-build'
Makefile:880: recipe for target 'all' failed
make: *** [all] Error 2

役に立つならば、LFS*変数は次のようになります。

LFS=/home/system/peal/system/system/toolchain
LFS_TGT=x86_64-peal-linux-gnu

私のビルドサーバーは毎日更新されるUbuntu 16.04(gcc 5.3)に基づいています。

ツールチェーンの詳細は次のとおりです。

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ gcc --version
gcc (GCC) 5.1.0
Copyright (C) 2015 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.

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ g++ --version
g++ (GCC) 5.1.0
Copyright (C) 2015 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.

me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ ld --version
GNU ld (GNU Binutils) 2.25.90.20151209
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ ldd --version
ldd (GNU libc) 2.21
Copyright (C) 2015 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.
Written by Roland McGrath and Ulrich Drepper.
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which ld
/tools/bin/ld
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which ldd
/tools/bin/ldd
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which gcc
/tools/bin/gcc
me@buildserver:/home/system/peal/system/system/toolchain/sources/gcc-build$ which g++
/tools/bin/g++

どんなアイデアがありますか?

ありがとうございます!

ベストアンサー1

問題を発見しました。

  • Munirが言ったように、私はsh代わりに。dashbash
  • その後、ヘッダーファイルgccが見つからないため、コンパイルに失敗しました。この問題はbuild:フラグを追加することで解決されました。rpc/xdr.hglibc--enable-obsolete-rpc

今、すべてが大丈夫です。

おすすめ記事