* [Qemu-devel] [PATCH v2] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode
@ 2019-01-14 14:49 Thomas Huth
2019-01-14 15:06 ` Daniel P. Berrangé
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2019-01-14 14:49 UTC (permalink / raw)
To: Peter Maydell, qemu-devel, berrange
Cc: Ronnie Sahlberg, Paolo Bonzini, Peter Lieven, qemu-block
The header "scsi-lowlevel.h" of libiscsi 1.9.0 contains some bad
"inline" prototype definitions which GCC refuses to compile in its
gnu99 mode:
In file included from block/iscsi.c:52:0:
/usr/include/iscsi/scsi-lowlevel.h:810:13: error: inline function
‘scsi_set_uint16’ declared but never defined [-Werror]
inline void scsi_set_uint16(unsigned char *c, uint16_t val);
^
/usr/include/iscsi/scsi-lowlevel.h:809:13: error: inline function
‘scsi_set_uint32’ declared but never defined [-Werror]
inline void scsi_set_uint32(unsigned char *c, uint32_t val);
^
This has been fixed by upstream libiscsi in version 1.10.0 (see
https://github.com/sahlberg/libiscsi/commit/7692027d6c11 ), but
since we still want to support 1.9.0 for CentOS 7 / RHEL7, we
have to work-around the issue by compiling with "-Wno-error"
in this case instead.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
v2: Use "-Wno-error" instead of "-fgnu89-inline"
configure | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configure b/configure
index 2b9ba7d..9514533 100755
--- a/configure
+++ b/configure
@@ -4562,6 +4562,11 @@ if test "$libiscsi" != "no" ; then
libiscsi="yes"
libiscsi_cflags=$($pkg_config --cflags libiscsi)
libiscsi_libs=$($pkg_config --libs libiscsi)
+ if $pkg_config --exact-version=1.9.0 libiscsi; then
+ # There are some bad inline declarations in scsi-lowlevel.h of
+ # libiscsi 1.9.0 which don't work in gnu99 mode, so we need this:
+ libiscsi_cflags="-Wno-error $libiscsi_cflags"
+ fi
else
if test "$libiscsi" = "yes" ; then
feature_not_found "libiscsi" "Install libiscsi >= 1.9.0"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode
2019-01-14 14:49 [Qemu-devel] [PATCH v2] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
@ 2019-01-14 15:06 ` Daniel P. Berrangé
0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2019-01-14 15:06 UTC (permalink / raw)
To: Thomas Huth
Cc: Peter Maydell, qemu-devel, Ronnie Sahlberg, Paolo Bonzini,
Peter Lieven, qemu-block
On Mon, Jan 14, 2019 at 03:49:48PM +0100, Thomas Huth wrote:
> The header "scsi-lowlevel.h" of libiscsi 1.9.0 contains some bad
> "inline" prototype definitions which GCC refuses to compile in its
> gnu99 mode:
>
> In file included from block/iscsi.c:52:0:
> /usr/include/iscsi/scsi-lowlevel.h:810:13: error: inline function
> ‘scsi_set_uint16’ declared but never defined [-Werror]
> inline void scsi_set_uint16(unsigned char *c, uint16_t val);
> ^
> /usr/include/iscsi/scsi-lowlevel.h:809:13: error: inline function
> ‘scsi_set_uint32’ declared but never defined [-Werror]
> inline void scsi_set_uint32(unsigned char *c, uint32_t val);
> ^
>
> This has been fixed by upstream libiscsi in version 1.10.0 (see
> https://github.com/sahlberg/libiscsi/commit/7692027d6c11 ), but
> since we still want to support 1.9.0 for CentOS 7 / RHEL7, we
> have to work-around the issue by compiling with "-Wno-error"
> in this case instead.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2: Use "-Wno-error" instead of "-fgnu89-inline"
>
> configure | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/configure b/configure
> index 2b9ba7d..9514533 100755
> --- a/configure
> +++ b/configure
> @@ -4562,6 +4562,11 @@ if test "$libiscsi" != "no" ; then
> libiscsi="yes"
> libiscsi_cflags=$($pkg_config --cflags libiscsi)
> libiscsi_libs=$($pkg_config --libs libiscsi)
> + if $pkg_config --exact-version=1.9.0 libiscsi; then
> + # There are some bad inline declarations in scsi-lowlevel.h of
> + # libiscsi 1.9.0 which don't work in gnu99 mode, so we need this:
> + libiscsi_cflags="-Wno-error $libiscsi_cflags"
> + fi
> else
> if test "$libiscsi" = "yes" ; then
> feature_not_found "libiscsi" "Install libiscsi >= 1.9.0"
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-14 15:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-14 14:49 [Qemu-devel] [PATCH v2] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
2019-01-14 15:06 ` Daniel P. Berrangé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).