diff mbox

configure: fix libcap detection

Message ID 1343648493-27905-1-git-send-email-avi@redhat.com
State New
Headers show

Commit Message

Avi Kivity July 30, 2012, 11:41 a.m. UTC
- avoid assigned-but-not-used error
 - avoid missing return error

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell July 30, 2012, 12:58 p.m. UTC | #1
On 30 July 2012 12:41, Avi Kivity <avi@redhat.com> wrote:
>  - avoid assigned-but-not-used error
>  - avoid missing return error
>
> Signed-off-by: Avi Kivity <avi@redhat.com>

There's already a patch on the list for this:
http://patchwork.ozlabs.org/patch/171704/

-- PMM
Richard W.M. Jones July 30, 2012, 10:04 p.m. UTC | #2
On Mon, Jul 30, 2012 at 02:41:33PM +0300, Avi Kivity wrote:
>  - avoid assigned-but-not-used error
>  - avoid missing return error
> 
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 7767aca..5fb449d 100755
> --- a/configure
> +++ b/configure
> @@ -2099,7 +2099,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(); (void)caps; return 0; }
>  EOF
>    if compile_prog "" "-lcap" ; then
>      cap=yes
> -- 
> 1.7.11.3
> 

I tested this patch and it fixes 9p detection for me.

Rich.
Aneesh Kumar K.V July 31, 2012, 6:52 a.m. UTC | #3
Avi Kivity <avi@redhat.com> writes:

>  - avoid assigned-but-not-used error
>  - avoid missing return error
>
> Signed-off-by: Avi Kivity <avi@redhat.com>

Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 7767aca..5fb449d 100755
> --- a/configure
> +++ b/configure
> @@ -2099,7 +2099,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(); (void)caps; return 0; }
>  EOF
>    if compile_prog "" "-lcap" ; then
>      cap=yes
> -- 
> 1.7.11.3
Stefan Weil July 31, 2012, 4:33 p.m. UTC | #4
Am 31.07.2012 08:52, schrieb Aneesh Kumar K.V:
> Avi Kivity <avi@redhat.com> writes:
>
>>   - avoid assigned-but-not-used error
>>   - avoid missing return error
>>
>> Signed-off-by: Avi Kivity <avi@redhat.com>
>
> Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> 	
>> ---
>>   configure | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index 7767aca..5fb449d 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2099,7 +2099,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(); (void)caps; return 0; }
>>   EOF
>>     if compile_prog "" "-lcap" ; then
>>       cap=yes
>> -- 
>> 1.7.11.3


Hi Anthony,

please apply http://patchwork.ozlabs.org/patch/171067/,
or we'll get a 4th bug fix for this.

Peter sent a series with this one and more patches on
2012-07-18 (1st: http://patchwork.ozlabs.org/patch/171686/).
At least the first 10 of them should be applied.

Please tell me if you need more information or support.

Cheers,
Stefan W.
Peter Maydell July 31, 2012, 4:40 p.m. UTC | #5
On 31 July 2012 17:33, Stefan Weil <sw@weilnetz.de> wrote:
> please apply http://patchwork.ozlabs.org/patch/171067/,
> or we'll get a 4th bug fix for this.
>
> Peter sent a series with this one and more patches on
> 2012-07-18 (1st: http://patchwork.ozlabs.org/patch/171686/).
> At least the first 10 of them should be applied.

More accurately:
 * apply the valgrind patch first:
   http://patchwork.ozlabs.org/patch/174029/
 * then apply the 11 patch configure series

I believe the valgrind test patch should fix the issues Blue Swirl
was seeing with the 11-patch series (and I tested it on debian
squeeze which I think has the same gcc Blue was using).

Patch 11/11 does enable -Werror on test code in a way which
causes configure to fail noisily if it encounters a warning:
I think it's better to commit this early rather than late
because then we can fix any lingering problems with odd
hosts or configurations which I missed. (The noisy failure
includes a clear message about how to work around it in
the interim, which is better than our current situation IMHO.)

thanks
-- PMM
Blue Swirl July 31, 2012, 5:06 p.m. UTC | #6
On Tue, Jul 31, 2012 at 4:40 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 31 July 2012 17:33, Stefan Weil <sw@weilnetz.de> wrote:
>> please apply http://patchwork.ozlabs.org/patch/171067/,
>> or we'll get a 4th bug fix for this.
>>
>> Peter sent a series with this one and more patches on
>> 2012-07-18 (1st: http://patchwork.ozlabs.org/patch/171686/).
>> At least the first 10 of them should be applied.
>
> More accurately:
>  * apply the valgrind patch first:
>    http://patchwork.ozlabs.org/patch/174029/
>  * then apply the 11 patch configure series
>
> I believe the valgrind test patch should fix the issues Blue Swirl
> was seeing with the 11-patch series (and I tested it on debian
> squeeze which I think has the same gcc Blue was using).
>
> Patch 11/11 does enable -Werror on test code in a way which
> causes configure to fail noisily if it encounters a warning:
> I think it's better to commit this early rather than late
> because then we can fix any lingering problems with odd
> hosts or configurations which I missed. (The noisy failure
> includes a clear message about how to work around it in
> the interim, which is better than our current situation IMHO.)

I'm still testing, at least up to 10/11 everything works.

>
> thanks
> -- PMM
Aneesh Kumar K.V July 31, 2012, 5:35 p.m. UTC | #7
Stefan Weil <sw@weilnetz.de> writes:

> Am 31.07.2012 08:52, schrieb Aneesh Kumar K.V:
>> Avi Kivity <avi@redhat.com> writes:
>>
>>>   - avoid assigned-but-not-used error
>>>   - avoid missing return error
>>>
>>> Signed-off-by: Avi Kivity <avi@redhat.com>
>>
>> Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>>
>> 	
>>> ---
>>>   configure | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/configure b/configure
>>> index 7767aca..5fb449d 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2099,7 +2099,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(); (void)caps; return 0; }
>>>   EOF
>>>     if compile_prog "" "-lcap" ; then
>>>       cap=yes
>>> -- 
>>> 1.7.11.3
>
>
> Hi Anthony,
>
> please apply http://patchwork.ozlabs.org/patch/171067/,
> or we'll get a 4th bug fix for this.

I sent a pull request for VirtFS taking the patch done by you
found at

http://patchwork.ozlabs.org/patch/171704/ 

That patch is important for VirtFS because without that VirtFS won't
be enabled in the build.

Let me know if you want me to redo the pull request.

-aneesh
Blue Swirl July 31, 2012, 5:56 p.m. UTC | #8
On Tue, Jul 31, 2012 at 4:40 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 31 July 2012 17:33, Stefan Weil <sw@weilnetz.de> wrote:
>> please apply http://patchwork.ozlabs.org/patch/171067/,
>> or we'll get a 4th bug fix for this.
>>
>> Peter sent a series with this one and more patches on
>> 2012-07-18 (1st: http://patchwork.ozlabs.org/patch/171686/).
>> At least the first 10 of them should be applied.
>
> More accurately:
>  * apply the valgrind patch first:
>    http://patchwork.ozlabs.org/patch/174029/
>  * then apply the 11 patch configure series
>
> I believe the valgrind test patch should fix the issues Blue Swirl
> was seeing with the 11-patch series (and I tested it on debian
> squeeze which I think has the same gcc Blue was using).
>
> Patch 11/11 does enable -Werror on test code in a way which
> causes configure to fail noisily if it encounters a warning:
> I think it's better to commit this early rather than late
> because then we can fix any lingering problems with odd
> hosts or configurations which I missed. (The noisy failure
> includes a clear message about how to work around it in
> the interim, which is better than our current situation IMHO.)

There are still problems, this time with Debian testing:
ERROR: configure test passed without -Werror but failed with -Werror.
This is probably a bug in the configure script. The failing command
will be at the bottom of config.log.
You can run configure with --disable-werror to bypass this check.

f--19750-.exe /tmp/qemu-conf--19750-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g
/tmp/qemu-conf--19750-.c:1:31: fatal error: valgrind/valgrind.h: No
such file or directory
compilation terminated.
gcc -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall
-Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing
-fstack-protector-all -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -I/usr/include/libpng12
-I/usr/include/nss -I/usr/include/nspr -pthread
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-o /tmp/qemu-conf--19750-.exe /tmp/qemu-conf--19750-.c -Wl,-z,relro
-Wl,-z,now -pie -m64 -g
gcc -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall
-Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing
-fstack-protector-all -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -I/usr/include/libpng12
-I/usr/include/nss -I/usr/include/nspr -pthread
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-o /tmp/qemu-conf--19750-.exe /tmp/qemu-conf--19750-.c -Wl,-z,relro
-Wl,-z,now -pie -m64 -g

>
> thanks
> -- PMM
Peter Maydell July 31, 2012, 5:59 p.m. UTC | #9
On 31 July 2012 18:56, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Tue, Jul 31, 2012 at 4:40 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> I believe the valgrind test patch should fix the issues Blue Swirl
>> was seeing with the 11-patch series (and I tested it on debian
>> squeeze which I think has the same gcc Blue was using).
>>
>> Patch 11/11 does enable -Werror on test code in a way which
>> causes configure to fail noisily if it encounters a warning:
>> I think it's better to commit this early rather than late
>> because then we can fix any lingering problems with odd
>> hosts or configurations which I missed. (The noisy failure
>> includes a clear message about how to work around it in
>> the interim, which is better than our current situation IMHO.)
>
> There are still problems, this time with Debian testing.

Hmm. Can we apply valgrind-patch + 1-10 for now? I think that
should be OK, and it would stem the flow of people submitting
further duplicate patches.

I'll look at the Debian testing issue.

-- PMM
diff mbox

Patch

diff --git a/configure b/configure
index 7767aca..5fb449d 100755
--- a/configure
+++ b/configure
@@ -2099,7 +2099,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(); (void)caps; return 0; }
 EOF
   if compile_prog "" "-lcap" ; then
     cap=yes