質問: gccのビルドに問題があります(libiberty obstack.cはコンパイルされません) ちょっと古いopensuse11.4を実行しているので、ビルドしたい別のものの更新された依存関係をビルドしようとしています。gcc-6.4.0のソースをダウンロードしました(最新のものも試しましたが、機能しませんでした)。../gcc-6.4.0/configure --prefix=/usr2/aakhavan/local --disable-multilib --enable-languages=c,c++ --disable-bootstrap --disable-libmpx --with-system-zlibを実行していますを使用してgcc-build>gcc -v using built-in specs. target: x86_64-suse-linux configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='suse linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux thread model: posix gcc version 4.3.4 [gcc-4_3-branch revision 152973] (suse linux) makeはこれで失敗します:gcc -c -dhave_config_h -g -o2 -i/usr2/aakhavan/local/src/gcc-chain/local/include -i. -i../../../gcc-6.4.0/libiberty/../include -w -wall -wwrite-strings -wc++-compat -wstrict-prototypes -pedantic -d_gnu_source ../../../gcc-6.4.0/libiberty/physmem.c -o physmem.o in file included from ../../../gcc-6.4.0/libiberty/partition.c:27: /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:424: warning: iso c90 does not support ‘long long’ in file included from ../../../gcc-6.4.0/libiberty/partition.c:27: /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:521:1: warning: c++ style comments are not allowed in iso c90 /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:521:1: warning: (this will be reported only once per input file) in file included from ../../../gcc-6.4.0/libiberty/obstack.c:63: /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:424: warning: iso c90 does not support ‘long long’ in file included from ../../../gcc-6.4.0/libiberty/obstack.c:63: /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:521:1: warning: c++ style comments are not allowed in iso c90 /usr2/aakhavan/local/src/gcc-chain/local/include/stdlib.h:521:1: warning: (this will be reported only once per input file) ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘call_chunkfun’: ../../../gcc-6.4.0/libiberty/obstack.c:92: error: request for member ‘extra’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:94: error: request for member ‘plain’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘call_freefun’: ../../../gcc-6.4.0/libiberty/obstack.c:101: error: request for member ‘extra’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:103: error: request for member ‘plain’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c: at top level: ../../../gcc-6.4.0/libiberty/obstack.c:115: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:115: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘_obstack_begin_worker’: ../../../gcc-6.4.0/libiberty/obstack.c:119: error: ‘alignment’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:119: error: (each undeclared identifier is reported only once ../../../gcc-6.4.0/libiberty/obstack.c:119: error: for each function it appears in.) ../../../gcc-6.4.0/libiberty/obstack.c:121: error: ‘size’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c: at top level: ../../../gcc-6.4.0/libiberty/obstack.c:157: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:157: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:156: error: conflicting types for ‘_obstack_begin’ /usr2/aakhavan/local/src/gcc-chain/local/include/obstack.h:183: error: previous declaration of ‘_obstack_begin’ was here ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘_obstack_begin’: ../../../gcc-6.4.0/libiberty/obstack.c:161: error: request for member ‘plain’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:162: error: request for member ‘plain’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:164: error: ‘size’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:164: error: ‘alignment’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:164: error: too many arguments to function ‘_obstack_begin_worker’ ../../../gcc-6.4.0/libiberty/obstack.c: at top level: ../../../gcc-6.4.0/libiberty/obstack.c:169: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:169: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:168: error: conflicting types for ‘_obstack_begin_1’ /usr2/aakhavan/local/src/gcc-chain/local/include/obstack.h:185: error: previous declaration of ‘_obstack_begin_1’ was here ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘_obstack_begin_1’: ../../../gcc-6.4.0/libiberty/obstack.c:174: error: request for member ‘extra’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:175: error: request for member ‘extra’ in something not a structure or union ../../../gcc-6.4.0/libiberty/obstack.c:178: error: ‘size’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:178: error: ‘alignment’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:178: error: too many arguments to function ‘_obstack_begin_worker’ ../../../gcc-6.4.0/libiberty/obstack.c: at top level: ../../../gcc-6.4.0/libiberty/obstack.c:188: error: expected declaration specifiers or ‘...’ before ‘_obstack_size_t’ ../../../gcc-6.4.0/libiberty/obstack.c:188: error: conflicting types for ‘_obstack_newchunk’ /usr2/aakhavan/local/src/gcc-chain/local/include/obstack.h:182: error: previous declaration of ‘_obstack_newchunk’ was here ../../../gcc-6.4.0/libiberty/obstack.c: in function ‘_obstack_newchunk’: ../../../gcc-6.4.0/libiberty/obstack.c:196: error: ‘length’ undeclared (first use in this function) ../../../gcc-6.4.0/libiberty/obstack.c:201: warning: comparison between signed and unsigned ../../../gcc-6.4.0/libiberty/obstack.c: at top level: ../../../gcc-6.4.0/libiberty/obstack.c:298: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_obstack_memory_used’ make[2]: *** [obstack.o] error 1 libiberityを無効にしようとしましたが、libtoolsのビルドについて文句を言います。オンラインで検索しましたが、答えが見つかりませんでした。一体何が起こっているのですか?
回答: obstack.c のコンパイルのエラーから、gcc-6.4.0をビルドするための適切な環境がないことは明らかです。gccは次のコマンドでインストールできることに注意してください。sudo zypper install gcc そして、パッケージ gcc6-6.5.0 + r265524-2.1.x86_64.rpm は download.opensuse.org/repositories/devel:/gcc/sle-のリポジトリにあります) 11/x86_64 / 、何もコンパイルする必要はありません。実際、古いパッケージが最初にコンパイルされた正確な環境を複製することは非常に困難です。そのリリースバージョンを見つけることははるかに簡単で時間もかかりません。 glibcは本当に 下位互換性 であるため、これは、環境内のglibcが新しい場合でも機能します。したがって、ヘッダーファイルのバージョンが適切でないために、そのプログラムをコンパイルできなくなった場合でも機能します。