configure: Allow builds -Weverything
PATCH 1/1 configure: Allow builds -Weverything
The clang compiler supports a useful compiler option -Weverything.
As this option triggers warnings in glib header files, too, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
---
With this patch, it is possible to build QEMU using this configuration:
./configure' --cc=clang-3.7 --cxx=clang++-3.7 --extra-cflags="-Weverything -DHAVE_FSXATTR" --disable-werror
(HAVE_FSXATTR avoids a fatal build error because of structure redefinition)
configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
@@ -2967,7 +2967,7 @@ int main(void) { } EOF -if ! compile_prog "-Werror $CFLAGS" "$LIBS" ; then +if ! compile_prog "$CFLAGS" "$LIBS" ; then error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ "You probably need to set PKG_CONFIG_LIBDIR"\ "to point to the right pkg-config files for your"\
Signature · 1 line
2.1.4
Quoted 23 lines · Stefan Weil
The clang compiler supports a useful compiler option -Weverything.
As this option triggers warnings in glib header files, too, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
Signed-off-by Stefan Weil <[email protected]>---
With this patch, it is possible to build QEMU using this configuration:
./configure' --cc=clang-3.7 --cxx=clang++-3.7 --extra-cflags="-Weverything -DHAVE_FSXATTR" --disable-werror
(
HAVE_FSXATTRavoids a fatal build error because of structure redefinition)configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configure +0
-0
configure int main(void) { · line 2973
Quoted 8 lines
configure +1
-1@@ -2967,7 +2967,7 @@ int main(void) { } EOF -if ! compile_prog "-Werror $CFLAGS" "$LIBS" ; then +if ! compile_prog "$CFLAGS" "$LIBS" ; then error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ "You probably need to set PKG_CONFIG_LIBDIR"\ "to point to the right pkg-config files for your"\
I've confirmed that this sizeof test still works as intended when the -Werror is removed. IIRC, the -Werror usage was left over from an earlier version of the patch
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Quoted 6 lines · Stefan Weil
The clang compiler supports a useful compiler option -Weverything.
As this option triggers warnings in glib header files, too, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
Quoted 8 lines
Signed-off-by Stefan Weil <[email protected]>---
With this patch, it is possible to build QEMU using this configuration:
./configure' --cc=clang-3.7 --cxx=clang++-3.7 --extra-cflags="-Weverything -DHAVE_FSXATTR" --disable-werror
(
HAVE_FSXATTRavoids a fatal build error because of structure redefinition)
No objection to the patch, but not for 2.6 at this stage I think.
(Does the configure patch re fsxattr that got a ping today avoid your need to define HAVE_FSXATTR by hand?)
thanks
-- PMM
Am 29.04.2016 um 10:51 schrieb Peter Maydell:
Quoted 14 lines · Stefan Weil
Quoted 13 lines
The clang compiler supports a useful compiler option -Weverything.
As this option triggers warnings in glib header files, too, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
Signed-off-by Stefan Weil <[email protected]>---
With this patch, it is possible to build QEMU using this configuration:
./configure' --cc=clang-3.7 --cxx=clang++-3.7 --extra-cflags="-Weverything -DHAVE_FSXATTR" --disable-werror
Quoted 8 lines
Quoted 1 line
(
HAVE_FSXATTRavoids a fatal build error because of structure redefinition)No objection to the patch, but not for 2.6 at this stage I think.
(Does the configure patch re fsxattr that got a ping today avoid your need to define
HAVE_FSXATTRby hand?)thanks
-- PMM
IMHO the patch is save for 2.6, but I don't insist on getting it into that version - although I already had the same problem with gcc + increased warning level (without finding the reason), so it is not specific for clang.
The configure patch which you are referring to is this one:
"configure: Check if struct fsxattr is available from linux header"
It can be found on qemu-trivial, but not on qemu-devel, patchworks or in my personal QEMU mails. Obviously this patch only reached qemu-trivial, but not qemu-devel. Perhaps that's why it did not get more attention.
The patch looks good, and I expect that it would solve the problem which I observed. Jan, could you please send it a 2nd time (cc me), so I can test it?
Thanks
Stefan
Am 29.04.2016 um 10:51 schrieb Peter Maydell:
Quoted 16 lines · Stefan Weil
Quoted 6 lines
The clang compiler supports a useful compiler option -Weverything.
As this option triggers warnings in glib header files, too, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
Quoted 8 lines
Signed-off-by Stefan Weil <[email protected]>---
With this patch, it is possible to build QEMU using this configuration:
./configure' --cc=clang-3.7 --cxx=clang++-3.7 --extra-cflags="-Weverything -DHAVE_FSXATTR" --disable-werror
(
HAVE_FSXATTRavoids a fatal build error because of structure redefinition)
Quoted 8 lines
No objection to the patch, but not for 2.6 at this stage I think.
(Does the configure patch re fsxattr that got a ping today avoid your need to define
HAVE_FSXATTRby hand?)thanks
-- PMM
I think this patch which was too late for 2.6.0 is a candidate for qemu-trivial, maybe also for qemu-stable. CC both mailing lists.
Stefan
Quoted 2 lines · Stefan Weil
I think this patch which was too late for 2.6.0 is a candidate for qemu-trivial, maybe also for qemu-stable. CC both mailing lists.
Yes, it is confusing to have --disable-werror compilations break because of warnings becoming errors. However, the subject is imprecise, what about:
----
configure: Allow builds with extra warnings
The clang compiler supports a useful compiler option -Weverything, and GCC also has other warnings not enabled by -Wall.
If glib header files trigger a warning, however, testing glib with -Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it.
----
Thanks,
Paolo
Am 16.05.2016 um 14:22 schrieb Paolo Bonzini:
Quoted 20 lines · Stefan Weil
Quoted 2 lines
I think this patch which was too late for 2.6.0 is a candidate for qemu-trivial, maybe also for qemu-stable. CC both mailing lists.
Yes, it is confusing to have --disable-werror compilations break because of warnings becoming errors. However, the subject is imprecise, what about:
----
configure: Allow builds with extra warningsThe clang compiler supports a useful compiler option -Weverything, and GCC also has other warnings not enabled by -Wall.
If glib header files trigger a warning, however, testing glib with
(quoted diff) +0
-3-Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it. ----
Quoted 3 lines
Thanks,
Paolo
Yes, that's a better description. Maybe Michael can use it when applying the patch.
Stefan
Quoted 21 lines · Stefan Weil
Am 16.05.2016 um 14:22 schrieb Paolo Bonzini:
Quoted 20 lines · Stefan Weil
Quoted 2 lines
I think this patch which was too late for 2.6.0 is a candidate for qemu-trivial, maybe also for qemu-stable. CC both mailing lists.
Yes, it is confusing to have --disable-werror compilations break because of warnings becoming errors. However, the subject is imprecise, what about:
----
configure: Allow builds with extra warningsThe clang compiler supports a useful compiler option -Weverything, and GCC also has other warnings not enabled by -Wall.
If glib header files trigger a warning, however, testing glib with
(quoted diff) +0
-3-Werror will always fail. A size mismatch is also detected without -Werror, so simply remove it. ----
Quoted 7 lines
Quoted 3 lines
Thanks,
Paolo
Yes, that's a better description. Maybe Michael can use it when applying the patch.
I'm sending a pull request with all sort of patches in a couple days, I can include this one too.
Paolo