diff --git a/0001-Fix-gcc-warning-on-non-x86-platform.patch b/0001-Fix-gcc-warning-on-non-x86-platform.patch new file mode 100644 index 0000000..59cb821 --- /dev/null +++ b/0001-Fix-gcc-warning-on-non-x86-platform.patch @@ -0,0 +1,42 @@ +From 2a2d9a8200f987b42966ab4e96b7769b8f9a159f Mon Sep 17 00:00:00 2001 +From: Gris Ge +Date: Wed, 22 Feb 2017 16:18:20 +0800 +Subject: [PATCH] udev: Fix gcc warning on non-x86 platform. + +Issue: + Got failure on s390x: + + scan-scsi-target.c:90:2: error: comparison is always true due to limited + range of data type [-Werror=type-limits] + +Root cause: + The error is on these lines: + + char c; + ... + while ((c = getopt_long(argc, argv, "rh", longopts, NULL)) != -1) { + + On non-x86 platform, char is unsigned. Which makes the (c != -1) + always true. + +Fix: + Take return of getopt_long() as int. + +Signed-off-by: Gris Ge +--- + tools/udev/scan-scsi-target.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/udev/scan-scsi-target.c b/tools/udev/scan-scsi-target.c +index bb83c65..00126b9 100644 +--- a/tools/udev/scan-scsi-target.c ++++ b/tools/udev/scan-scsi-target.c +@@ -54,7 +54,7 @@ static void __attribute__ ((__noreturn__)) invalid(char **argv, char *devpath) + + int main(int argc, char **argv) + { +- char c; ++ int c; + char *devpath; + + char *sysfs_path; diff --git a/libstoragemgmt.changes b/libstoragemgmt.changes index 8671db1..30cec34 100644 --- a/libstoragemgmt.changes +++ b/libstoragemgmt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 25 07:27:25 UTC 2017 - alarrosa@suse.com + +- Add 0001-Fix-gcc-warning-on-non-x86-platform.patch to fix build in + ppc64le/s390x. + ------------------------------------------------------------------- Mon Apr 24 11:10:59 UTC 2017 - alarrosa@suse.com diff --git a/libstoragemgmt.spec b/libstoragemgmt.spec index 72dcbb3..1447404 100644 --- a/libstoragemgmt.spec +++ b/libstoragemgmt.spec @@ -26,6 +26,8 @@ License: LGPL-2.1+ Group: System/Libraries Url: https://github.com/libstorage/libstoragemgmt Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM 0001-Fix-gcc-warning-on-non-x86-platform.patch -- Fix build in ppc64le/s390x related to getopt_long +Patch0: 0001-Fix-gcc-warning-on-non-x86-platform.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libconfig-devel @@ -192,6 +194,7 @@ management via hpssacli. %prep %setup -q +%patch0 -p1 %build %configure \