[Armadillo:07871] Re: Armadillo440コンパイルエラー【-Wno-suggest-attribute=const】

Takenoshita Koyo email@hidden
2012年 1月 27日 (金) 19:14:17 JST


竹之下です。

エラー発生直前の、

gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -DIN_LIBVIRT -I/usr/include/libxml2 -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wattributes -Wcoverage-mismatch -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-all --pa
ram=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -g -O2 -MT libvirt_util_la-virkeycode.lo -MD -MP -MF .deps/libvirt_util_la-virkeycode.Tpo -c util/virkeycode.c  -fPIC -DPIC -o .libs/libvirt_util_la-virkeycode.o

というコマンドを単体で実行した場合も、エラーになるでしょうか?

「-Wno-suggest-attribute=pure -Wno-suggest-attribute=const」を取り除いたら、上手くいくでしょうか?

もし、取り除いて上手く行くのであれば、そのまま再度makeをしてしまえば、通るかもしれません。

根本的には、configureスクリプトが、「-Wno-suggest-attribute=pure -Wno-suggest-attribute=const」を
使えない、と判断するように修正するのが良いと思います。

(2012年01月27日 17:20), 冨澤 則喜 wrote:
> 竹之下様
>
> 冨澤です。
> ご回答ありがとうございます。
>
> 直近の結果では、ありませんが、
> Armadillo440で、make V=1した端末ログが、
> 残っていましたので、以下に記載します。
>
> お手数ですが、よろしくお願い致します。
>
> 【make V=1 実行ログ】
>> # make V=1
>> make  all-recursive
>> make[1]: Entering directory `/root/libvirt-0.9.9'
>> Making all in gnulib/lib
>> make[2]: Entering directory `/root/libvirt-0.9.9/gnulib/lib'
>> make  all-recursive
>> make[3]: Entering directory `/root/libvirt-0.9.9/gnulib/lib'
>> make[4]: Entering directory `/root/libvirt-0.9.9/gnulib/lib'
>> make[4]: Nothing to be done for `all-am'.
>> make[4]: Leaving directory `/root/libvirt-0.9.9/gnulib/lib'
>> make[3]: Leaving directory `/root/libvirt-0.9.9/gnulib/lib'
>> make[2]: Leaving directory `/root/libvirt-0.9.9/gnulib/lib'
>> Making all in include
>> make[2]: Entering directory `/root/libvirt-0.9.9/include'
>> Making all in libvirt
>> make[3]: Entering directory `/root/libvirt-0.9.9/include/libvirt'
>> make[3]: Nothing to be done for `all'.
>> make[3]: Leaving directory `/root/libvirt-0.9.9/include/libvirt'
>> make[3]: Entering directory `/root/libvirt-0.9.9/include'
>> make[3]: Nothing to be done for `all-am'.
>> make[3]: Leaving directory `/root/libvirt-0.9.9/include'
>> make[2]: Leaving directory `/root/libvirt-0.9.9/include'
>> Making all in src
>> make[2]: Entering directory `/root/libvirt-0.9.9/src'
>> make  all-am
>> make[3]: Entering directory `/root/libvirt-0.9.9/src'
>> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -DIN_LIBVIRT        -I/usr/include/libxml2   -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wattributes -Wcoverage-mismatch -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-non
literal -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const      -g -O2 -MT libvirt_util_la-virkeycode.lo -MD -MP -MF .deps/libvirt_util_la-virkeycode.Tpo -c -o libvirt_util_la-virkeycode.lo `test -f 'util/virkeycode.c' || echo './'`util/virkeycode.c
>> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -DIN_LIBVIRT -I/usr/include/libxml2 -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wattributes -Wcoverage-mismatch -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral -Wp,-D_FORTIFY_SOURCE=2 -fst
ack-protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -g -O2 -MT libvirt_util_la-virkeycode.lo -MD -MP -MF .deps/libvirt_util_la-virkeycode.Tpo -c util/virkeycode.c  -fPIC -DPIC -o .libs/libvirt_util_la-virkeycode.o
>> util/virkeycode.c: In function '__virKeycodeValueFromString':
>> util/virkeycode.c:91: warning: cast increases required alignment of target type [-Wcast-align]
>> util/virkeycode.c:94: warning: cast increases required alignment of target type [-Wcast-align]
>> util/virkeycode.c: In function '__virKeycodeValueTranslate':
>> util/virkeycode.c:127: warning: cast increases required alignment of target type [-Wcast-align]
>> util/virkeycode.c:128: warning: cast increases required alignment of target type [-Wcast-align]
>> At top level:
>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=const"
>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure"
>> make[3]: *** [libvirt_util_la-virkeycode.lo] Error 1
>> make[3]: Leaving directory `/root/libvirt-0.9.9/src'
>> make[2]: *** [all] Error 2
>> make[2]: Leaving directory `/root/libvirt-0.9.9/src'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/root/libvirt-0.9.9'
>> make: *** [all] Error 2
>> #
>
> On Fri, 27 Jan 2012 16:02:31 +0900
> Takenoshita Koyo<email@hidden>  wrote:
>
>> 竹之下です。
>>
>> すみません。普通にmakeしたときのログでは、実際にどんなコマンドが実行
>> されたか表示されないので、
>>
>> $ make V=1 2>&1 | tee make.log
>>
>> として実行していただけますか?
>>
>> エラーが発生しているのは、実際にはどんなコマンドなのでしょうか?
>>
>> PCでビルドした場合は、util/virkeycode.cのコンパイルのために、
>> 以下のようなコマンドが実行されているようです。
>>
>> libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include -I../src/util -I../include -DIN_LIBVIRT -I/usr/include/libxml2 -Wall -W -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var -Wdisabled-optimization -Wattributes -Wcoverage-mismatch -Wmultichar -Wdeprecated-declarations -Wdiv-by-zero -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-nonliteral -Wp,-D_FORTIFY_SOURCE=2 -fst
ack
>> -protector-all --param=ssp-buffer-size=4 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -funit-at-a-time -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -g -O2 -MT libvirt_util_la-virkeycode.lo -MD -MP -MF .deps/libvirt_util_la-virkeycode.Tpo -c util/virkeycode.c -o libvirt_util_la-virkeycode.o>/dev/null 2>&1
>>
>> (2012年01月25日 21:09), 冨澤 則喜 wrote:
>>> 竹之下様
>>>
>>> 冨澤です。
>>> ご回答ありがとうございます。
>>>
>>> エラーになったときに別のコンパイラを
>>> 使用しておりません。
>>> aptitude install gccでインストールした
>>> セルフ開発環境で、ビルドしています。
>>>
>>> TeraTerm記録を保存していたので、
>>> メールに添付致します。
>>>
>>> お手数ですが、よろしくお願い致します。
>>> On Wed, 25 Jan 2012 19:30:05 +0900
>>> Takenoshita Koyo<email@hidden>   wrote:
>>>
>>>> 竹之下です。
>>>>
>>>>> "-Wno-suggest-attribute=const"コンパイルテストを
>>>>> してみました。
>>>>>
>>>>> Armadillo440とATDE3 両方とも同じ結果で、
>>>>> 問題ないようです。
>>>> そうすると、エラーになったときには何か別のコンパイラを使用しているのでしょうか?
>>>>
>>>> [armadillo ~/libvirt-0.9.9]# ./configure
>>>> [armadillo ~/libvirt-0.9.9]# make 2>&1 | tee make.log
>>>>
>>>> としたときの、config.logとmake.logを添付していただくことはできますか?
>>>>
>>>> (2012年01月24日 20:21), 冨澤 則喜 wrote:
>>>>> 竹之下様
>>>>>
>>>>> 冨澤です。ご回答ありがとうございました。
>>>>>
>>>>> "-Wno-suggest-attribute=const"コンパイルテストを
>>>>> してみました。
>>>>>
>>>>> Armadillo440とATDE3 両方とも同じ結果で、
>>>>> 問題ないようです。
>>>>> ログを以下に記載します。
>>>>>
>>>>> arm-gccの環境で、コンパイルオプションの
>>>>> 組み合わせによって、出るエラーでしょうか。
>>>>>
>>>>> よろしくお願い致します。
>>>>>
>>>>> 【②Armadillo440】
>>>>>> # touch empty.c
>>>>>> # gcc -E -Wno-suggest-attribute=const empty.c
>>>>>> # 1 "empty.c"
>>>>>> # 1 "<built-in>"
>>>>>> # 1 "<command-line>"
>>>>>> # 1 "empty.c"
>>>>>
>>>>> 【①ATDE3】
>>>>>> email@hidden:/media/hgfs$ touch empty.c
>>>>>> email@hidden:/media/hgfs$ gcc -E -Wno-suggest-attribute=const empty.c
>>>>>> # 1 "empty.c"
>>>>>> # 1 "<built-in>"
>>>>>> # 1 "<command-line>"
>>>>>> # 1 "empty.c"
>>>>>
>>>>> On Tue, 24 Jan 2012 19:36:07 +0900
>>>>> Takenoshita Koyo<email@hidden>    wrote:
>>>>>
>>>>>>
>>>>>>> Armadillo-440上のセルフコンパイル環境で
>>>>>>> configureしています。
>>>>>> Armadillo-440上で下記コマンドを実行すると、どのような結果になりますか?
>>>>>>
>>>>>> $ touch empty.c
>>>>>> $ gcc -E -Wno-suggest-attribute=const empty.c
>>>>>>
>>>>>> 上記コマンドでエラーが発生すれば、configureが
>>>>>>>> checking whether compiler handles -Wno-suggest-attribute=const... yes
>>>>>> と判断するのが、間違っていることになります。
>>>>>>
>>>>>> (2012年01月24日 18:38), 冨澤 則喜 wrote:
>>>>>>> 竹之下様
>>>>>>>
>>>>>>> 冨澤です。ご回答ありがとうございました。
>>>>>>>
>>>>>>> Armadillo-440上のセルフコンパイル環境で
>>>>>>> configureしています。
>>>>>>>
>>>>>>> Armadillo-440上で、wgetしたソースを
>>>>>>> 解凍して、configureしております。
>>>>>>>
>>>>>>> configure環境チェックでは、"yes"になっていました。
>>>>>>> ログを以下に記載します。
>>>>>>>
>>>>>>> ①ATDE3側と②Armadillo440の
>>>>>>> configureログの差分をdiffしましたが、
>>>>>>> "checking whether compiler handles"など
>>>>>>> コンパイラ関連のチェックに差分は、
>>>>>>> ありませんでした。
>>>>>>>
>>>>>>> よろしくお願い致します。
>>>>>>>
>>>>>>> 【configure環境チェック】
>>>>>>>> checking whether compiler handles -Wno-format-nonliteral... yes
>>>>>>>> checking whether compiler handles -Wframe-larger-than=4096... no
>>>>>>>> checking whether compiler handles -Wp,-D_FORTIFY_SOURCE=2... yes
>>>>>>>> checking whether compiler handles -fstack-protector-all... yes
>>>>>>>> checking whether compiler handles --param=ssp-buffer-size=4... yes
>>>>>>>> checking whether compiler handles -fexceptions... yes
>>>>>>>> checking whether compiler handles -fasynchronous-unwind-tables... yes
>>>>>>>> checking whether compiler handles -fdiagnostics-show-option... yes
>>>>>>>> checking whether compiler handles -funit-at-a-time... yes
>>>>>>>> checking whether compiler handles -fipa-pure-const... yes
>>>>>>>> checking whether compiler handles -Wno-suggest-attribute=pure... yes
>>>>>>>> checking whether compiler handles -Wno-suggest-attribute=const... yes
>>>>>>>> checking whether compiler handles -Wno-redundant-decls... yes
>>>>>>>
>>>>>>>
>>>>>>> On Tue, 24 Jan 2012 18:05:13 +0900
>>>>>>> Takenoshita Koyo<email@hidden>     wrote:
>>>>>>>
>>>>>>>> 竹之下です。
>>>>>>>>
>>>>>>>>> "-Wno-suggest-attribute=const"
>>>>>>>>> "-Wno-suggest-attribute=pure"という
>>>>>>>>> コンパイルオプションでエラーが出ております。
>>>>>>>>>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=const"
>>>>>>>>>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure"
>>>>>>>> cc1は、"-Wno-suggest-attribute=const"というオプションを認識できない、と言っていますね。
>>>>>>>>
>>>>>>>>> 【開発環境】
>>>>>>>>> ②Armadillo440(コンパイル・エラー)
>>>>>>>>> gcc version 4.3.2 (Debian 4.3.2-1.1)
>>>>>>>> は、どのような環境でしょうか?
>>>>>>>> Armadillo-440上でセルフコンパイル環境を構築されていますか?
>>>>>>>> それとも、ATDE3上でクロスコンパイルされていますか?
>>>>>>>>
>>>>>>>> configureスクリプトで、"-Wno-suggest-attribute=const"が使えるかどうか確認している
>>>>>>>> ようなので、configureが上手く行っていない(configureで確認しているコンパイラと、
>>>>>>>> makeしているときに使っているコンパイラが異なる)か、
>>>>>>>> configureスクリプトにバグがあるのではないかと思います。
>>>>>>>> Armadillo-440用にビルドする際に、再度configureを行っていますか?
>>>>>>>>
>>>>>>>> (2012年01月24日 15:54), 冨澤 則喜 wrote:
>>>>>>>>>
>>>>>>>>> 冨澤と申します。
>>>>>>>>>
>>>>>>>>> Armadillo 440を使用した機器を開発しております。
>>>>>>>>>
>>>>>>>>> Armadillo440コンパイルエラーに
>>>>>>>>> 関して投稿させて頂きました。
>>>>>>>>>
>>>>>>>>> libvirtというソフトウェアを
>>>>>>>>> まずATDE3で、コンパイルしたところ
>>>>>>>>> 問題なく configure&      make出来ました。
>>>>>>>>>
>>>>>>>>> そして、Armadillo440で、ほぼ同じ環境を整えて、
>>>>>>>>> コンパイルした所、以下に記載した
>>>>>>>>> コンパイルエラーが、出ました。
>>>>>>>>>
>>>>>>>>> "-Wno-suggest-attribute=const"
>>>>>>>>> "-Wno-suggest-attribute=pure"という
>>>>>>>>> コンパイルオプションでエラーが出ております。
>>>>>>>>>
>>>>>>>>> 対策をご存知の方が、おられましたら、
>>>>>>>>> お教え願えますよう 宜しくお願い致します。
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 【開発環境】
>>>>>>>>> ①ATDE3(コンパイル・インストールOK)
>>>>>>>>> gcc version 4.3.2 (Debian 4.3.2-1.1)
>>>>>>>>>
>>>>>>>>> ②Armadillo440(コンパイル・エラー)
>>>>>>>>> gcc version 4.3.2 (Debian 4.3.2-1.1)
>>>>>>>>>
>>>>>>>>> 【コンパイルエラー・ログ】
>>>>>>>>>> util/virkeycode.c: In function '__virKeycodeValueFromString':
>>>>>>>>>> util/virkeycode.c:91: warning: cast increases required alignment of target type [-Wcast-align]
>>>>>>>>>> util/virkeycode.c:94: warning: cast increases required alignment of target type [-Wcast-align]
>>>>>>>>>> util/virkeycode.c: In function '__virKeycodeValueTranslate':
>>>>>>>>>> util/virkeycode.c:127: warning: cast increases required alignment of target type [-Wcast-align]
>>>>>>>>>> util/virkeycode.c:128: warning: cast increases required alignment of target type [-Wcast-align]
>>>>>>>>>> At top level:
>>>>>>>>>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=const"
>>>>>>>>>> cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure"
>>>>>>>>>> make[3]: *** [libvirt_util_la-virkeycode.lo] Error 1
>>>>>>>>>> make[3]: Leaving directory `/root/libvirt-0.9.9/src'
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> armadillo mailing list
>>>>>>>>> email@hidden
>>>>>>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Koyo Takenoshita
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> armadillo mailing list
>>>>>>>> email@hidden
>>>>>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> armadillo mailing list
>>>>>>> email@hidden
>>>>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Koyo Takenoshita
>>>>>>
>>>>>> _______________________________________________
>>>>>> armadillo mailing list
>>>>>> email@hidden
>>>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> armadillo mailing list
>>>>> email@hidden
>>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>>
>>>>
>>>> --
>>>> Koyo Takenoshita
>>>>
>>>> _______________________________________________
>>>> armadillo mailing list
>>>> email@hidden
>>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>>
>>>
>>>
>>> _______________________________________________
>>> armadillo mailing list
>>> email@hidden
>>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>>
>>
>> --
>> Koyo Takenoshita
>>
>> _______________________________________________
>> armadillo mailing list
>> email@hidden
>> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo
>
>
> _______________________________________________
> armadillo mailing list
> email@hidden
> http://lists.atmark-techno.com/cgi-bin/mailman/listinfo/armadillo


-- 
Koyo Takenoshita




armadillo メーリングリストの案内