it-swarm-ja.com

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のビルドについて文句を言います。オンラインで検索しましたが、答えが見つかりませんでした。一体何が起こっているのですか?

3
Kayson

obstack.c のコンパイルのエラーから、gcc-6.4.0をビルドするための適切な環境がないことは明らかです。

Gccは次のコマンドでインストールできることに注意してください。

Sudo zypper install gcc

そして、パッケージ gcc6-6.5.0 + r265524-2.1.x86_64.rpmdownload.opensuse.org/repositories/devel:/gcc/SLE-のリポジトリにあります) 11/x86_64 / 、何もコンパイルする必要はありません。

実際、古いパッケージが最初にコンパイルされた正確な環境を複製することは非常に困難です。そのリリースバージョンを見つけることははるかに簡単で時間もかかりません。 glibcは本当に 下位互換性 であるため、これは、環境内のglibcが新しい場合でも機能します。したがって、ヘッダーファイルのバージョンが適切でないために、そのプログラムをコンパイルできなくなった場合でも機能します。

1
harrymc