2 Dec 2011 19:41
bug#10197: compilation failure with no message caused by libtool
Eric Blake <eblake <at> redhat.com>
2011-12-02 18:41:22 GMT
2011-12-02 18:41:22 GMT
I ran into a weird case today - trying to compile libvirt with CFLAGS including -Wsuggest-attribute=pure -fipa-pure-const produced a compile failure, but no message. It turns out that for the file in question, libtool ended up compiling things twice, but gcc only warns when -fPIC is not in effect (for some reason, the combination of fPIC and -fipa-pure-const appears to not catch the warning, unless -O is also present). $ 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 -Wsuggest-attribute=pure -fipa-pure-const -c util/buf.c -fPIC -DPIC -o a.o $ 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 -Wsuggest-attribute=pure -fipa-pure-const -c util/buf.c -o b.o util/buf.c:86:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] util/buf.c:227:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] util/buf.c:242:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] But because the warning only occurs during the second compilation, I end up with no warning message: $ make make all-am make[1]: Entering directory `/home/remote/eblake/libvirt/src'(Continue reading)
RSS Feed