Package: libtool;
Reported by: Eric Blake <eblake <at> redhat.com>
Date: Fri, 2 Dec 2011 18:42:01 UTC
Severity: normal
To reply to this bug, email your comments to 10197 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-libtool <at> gnu.org
:bug#10197
; Package libtool
.
(Fri, 02 Dec 2011 18:42:02 GMT) Full text and rfc822 format available.Eric Blake <eblake <at> redhat.com>
:bug-libtool <at> gnu.org
.
(Fri, 02 Dec 2011 18:42:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Eric Blake <eblake <at> redhat.com> To: bug-libtool <at> gnu.org Subject: compilation failure with no message caused by libtool Date: Fri, 02 Dec 2011 11:41:22 -0700
[Message part 1 (text/plain, inline)]
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' CC libvirt_util_la-buf.lo make[1]: *** [libvirt_util_la-buf.lo] Error 1 make[1]: Leaving directory `/home/remote/eblake/libvirt/src' make: *** [all] Error 2 Proof that -O makes a difference: $ 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 -O util/buf.c: In function ‘virBufferGetIndent’: util/buf.c:86:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] util/buf.c: In function ‘virBufferError’: util/buf.c:227:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] util/buf.c: In function ‘virBufferUse’: util/buf.c:242:1: warning: function might be candidate for attribute ‘pure’ [-Wsuggest-attribute=pure] The full libtool invocation in question: $ make V=1 make all-am make[1]: Entering directory `/home/remote/eblake/libvirt/src' /bin/sh ../libtool --tag=CC --mode=compile ccache 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 -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat -Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wabi -Wcpp -Wdeprecated -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init -Wno-format-nonliteral -Wframe-larger-than=4096 -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 -Werror -g -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo -c -o libvirt_util_la-buf.lo `test -f 'util/buf.c' || echo './'`util/buf.c libtool: compile: ccache 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 -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat -Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wabi -Wcpp -Wdeprecated -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init -Wno-format-nonliteral -Wframe-larger-than=4096 -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 -Werror -g -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo -c util/buf.c -fPIC -DPIC -o .libs/libvirt_util_la-buf.o libtool: compile: ccache 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 -Wbuiltin-macro-redefined -Wmudflap -Wpacked-bitfield-compat -Wsync-nand -Wattributes -Wcoverage-mismatch -Wmultichar -Wabi -Wcpp -Wdeprecated -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar -Wnormalized=nfc -Woverflow -Wpointer-to-int-cast -Wpragmas -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wno-missing-field-initializers -Wno-sign-compare -Wjump-misses-init -Wno-format-nonliteral -Wframe-larger-than=4096 -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 -Werror -g -MT libvirt_util_la-buf.lo -MD -MP -MF .deps/libvirt_util_la-buf.Tpo -c util/buf.c -o libvirt_util_la-buf.o >/dev/null 2>&1 make[1]: *** [libvirt_util_la-buf.lo] Error 1 make[1]: Leaving directory `/home/remote/eblake/libvirt/src' make: *** [all] Error 2 Any suggestions on how to make libtool display the compiler errors that occur only when -fPIC is missing? Or am I stuck not using -fipa-pure-const without also passing -O? -- Eric Blake eblake <at> redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
bug-libtool <at> gnu.org
:bug#10197
; Package libtool
.
(Fri, 02 Dec 2011 19:50:02 GMT) Full text and rfc822 format available.Message #8 received at 10197 <at> debbugs.gnu.org (full text, mbox):
From: Peter O'Gorman <peter <at> pogma.com> To: Eric Blake <eblake <at> redhat.com> Cc: 10197 <at> debbugs.gnu.org Subject: Re: bug#10197: compilation failure with no message caused by libtool Date: Fri, 02 Dec 2011 13:49:03 -0600
On 12/02/2011 12:41 PM, Eric Blake wrote: > > Any suggestions on how to make libtool display the compiler errors that > occur only when -fPIC is missing? Or am I stuck not using > -fipa-pure-const without also passing -O? Does -no-suppress do this? Peter
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.