All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Fix build with capabilities
@ 2012-07-15 13:54 Stefan Weil
  2012-07-16 15:35 ` Eric Blake
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2012-07-15 13:54 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Stefan Weil, qemu-devel

Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests
normally run with -Werror. Some of these tests now fail because they
raised a compiler warning.

This patch fixes support for capabilities.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 configure |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f745cc2..abde4c0 100755
--- a/configure
+++ b/configure
@@ -2082,7 +2082,7 @@ if test "$cap" != "no" ; then
   cat > $TMPC <<EOF
 #include <stdio.h>
 #include <sys/capability.h>
-int main(void) { cap_t caps; caps = cap_init(); }
+int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; }
 EOF
   if compile_prog "" "-lcap" ; then
     cap=yes
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
  2012-07-15 13:54 [Qemu-devel] [PATCH] configure: Fix build with capabilities Stefan Weil
@ 2012-07-16 15:35 ` Eric Blake
  2012-07-16 15:40   ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Blake @ 2012-07-16 15:35 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Blue Swirl, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On 07/15/2012 07:54 AM, Stefan Weil wrote:
> Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests
> normally run with -Werror. Some of these tests now fail because they
> raised a compiler warning.
> 
> This patch fixes support for capabilities.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  configure |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index f745cc2..abde4c0 100755
> --- a/configure
> +++ b/configure
> @@ -2082,7 +2082,7 @@ if test "$cap" != "no" ; then
>    cat > $TMPC <<EOF
>  #include <stdio.h>
>  #include <sys/capability.h>
> -int main(void) { cap_t caps; caps = cap_init(); }
> +int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; }

Nothing wrong with this patch, per se, but in the Autoconf world, the
general advice is that programs should check whether -Werror is
supported, but then avoid using it for the entire remainder of the
configure script (that is, store the result of -Werror into a different
variable that gets added into the final CFLAGS at make time, but not
used during any of the rest of the configure time).  That's because it's
just too hard to avoid warnings-turned-into-errors for all possible
versions (including future releases) of gcc, so you are just too likely
to run into spurious changes in configurations when the next version of
gcc starts warning about something new if you try to run all your
configure tests with -Werror.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
  2012-07-16 15:35 ` Eric Blake
@ 2012-07-16 15:40   ` Peter Maydell
  2012-07-16 17:24     ` Alexander Graf
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2012-07-16 15:40 UTC (permalink / raw)
  To: Eric Blake; +Cc: Blue Swirl, Stefan Weil, qemu-devel, Alexander Graf

On 16 July 2012 16:35, Eric Blake <eblake@redhat.com> wrote:
> On 07/15/2012 07:54 AM, Stefan Weil wrote:
>> Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests
>> normally run with -Werror. Some of these tests now fail because they
>> raised a compiler warning.

> Nothing wrong with this patch, per se, but in the Autoconf world, the
> general advice is that programs should check whether -Werror is
> supported, but then avoid using it for the entire remainder of the
> configure script (that is, store the result of -Werror into a different
> variable that gets added into the final CFLAGS at make time, but not
> used during any of the rest of the configure time).  That's because it's
> just too hard to avoid warnings-turned-into-errors for all possible
> versions (including future releases) of gcc, so you are just too likely
> to run into spurious changes in configurations when the next version of
> gcc starts warning about something new if you try to run all your
> configure tests with -Werror.

Hmm, good point -- unlike the actual program compile, failures
due to -Werror inside configure are silent and near-invisible.
Maybe we should back out 417c9d72 ?

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
  2012-07-16 15:40   ` Peter Maydell
@ 2012-07-16 17:24     ` Alexander Graf
  2012-07-16 18:28       ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Graf @ 2012-07-16 17:24 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Blue Swirl, Stefan Weil, Eric Blake, qemu-devel

On 07/16/2012 05:40 PM, Peter Maydell wrote:
> On 16 July 2012 16:35, Eric Blake <eblake@redhat.com> wrote:
>> On 07/15/2012 07:54 AM, Stefan Weil wrote:
>>> Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests
>>> normally run with -Werror. Some of these tests now fail because they
>>> raised a compiler warning.
>> Nothing wrong with this patch, per se, but in the Autoconf world, the
>> general advice is that programs should check whether -Werror is
>> supported, but then avoid using it for the entire remainder of the
>> configure script (that is, store the result of -Werror into a different
>> variable that gets added into the final CFLAGS at make time, but not
>> used during any of the rest of the configure time).  That's because it's
>> just too hard to avoid warnings-turned-into-errors for all possible
>> versions (including future releases) of gcc, so you are just too likely
>> to run into spurious changes in configurations when the next version of
>> gcc starts warning about something new if you try to run all your
>> configure tests with -Werror.
> Hmm, good point -- unlike the actual program compile, failures
> due to -Werror inside configure are silent and near-invisible.
> Maybe we should back out 417c9d72 ?

So how do we deal with the original problem then? The one where the 
build broke for me because the smartcard code got compiled in because 
configure didn't know that it would fail to compile with -Werror?


Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
  2012-07-16 17:24     ` Alexander Graf
@ 2012-07-16 18:28       ` Peter Maydell
  2012-07-16 18:33         ` Alexander Graf
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2012-07-16 18:28 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Blue Swirl, Stefan Weil, Eric Blake, qemu-devel

On 16 July 2012 18:24, Alexander Graf <agraf@suse.de> wrote:
> On 07/16/2012 05:40 PM, Peter Maydell wrote:
>> Hmm, good point -- unlike the actual program compile, failures
>> due to -Werror inside configure are silent and near-invisible.
>> Maybe we should back out 417c9d72 ?
>
> So how do we deal with the original problem then? The one where the build
> broke for me because the smartcard code got compiled in because configure
> didn't know that it would fail to compile with -Werror?

We could have a specific configure check for "can you include
this header file in a -Werror compilation", I guess?

-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Fix build with capabilities
  2012-07-16 18:28       ` Peter Maydell
@ 2012-07-16 18:33         ` Alexander Graf
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2012-07-16 18:33 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Blue Swirl, Stefan Weil, Eric Blake, qemu-devel


On 16.07.2012, at 20:28, Peter Maydell wrote:

> On 16 July 2012 18:24, Alexander Graf <agraf@suse.de> wrote:
>> On 07/16/2012 05:40 PM, Peter Maydell wrote:
>>> Hmm, good point -- unlike the actual program compile, failures
>>> due to -Werror inside configure are silent and near-invisible.
>>> Maybe we should back out 417c9d72 ?
>> 
>> So how do we deal with the original problem then? The one where the build
>> broke for me because the smartcard code got compiled in because configure
>> didn't know that it would fail to compile with -Werror?
> 
> We could have a specific configure check for "can you include
> this header file in a -Werror compilation", I guess?

That's what my first patch did.


Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-16 18:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-15 13:54 [Qemu-devel] [PATCH] configure: Fix build with capabilities Stefan Weil
2012-07-16 15:35 ` Eric Blake
2012-07-16 15:40   ` Peter Maydell
2012-07-16 17:24     ` Alexander Graf
2012-07-16 18:28       ` Peter Maydell
2012-07-16 18:33         ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.