- fix build with new glibc - use sysmacros.h for major()/minor()
This commit is contained in:
parent
238aa2f14f
commit
f9ac9388b3
@ -1,92 +0,0 @@
|
||||
diff -rup sg3_utils-1.38.orig/aclocal.m4 sg3_utils-1.38/aclocal.m4
|
||||
--- sg3_utils-1.38.orig/aclocal.m4 2013-10-31 16:01:34.000000000 +0100
|
||||
+++ sg3_utils-1.38/aclocal.m4 2014-04-18 15:13:20.000000000 +0200
|
||||
@@ -1326,7 +1326,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@@ -1338,16 +1338,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
|
||||
LD="${LD-ld} -m elf_i386_fbsd"
|
||||
;;
|
||||
x86_64-*linux*)
|
||||
- case `/usr/bin/file conftest.o` in
|
||||
- *x86-64*)
|
||||
- LD="${LD-ld} -m elf32_x86_64"
|
||||
- ;;
|
||||
- *)
|
||||
- LD="${LD-ld} -m elf_i386"
|
||||
- ;;
|
||||
- esac
|
||||
+ LD="${LD-ld} -m elf_i386"
|
||||
+ ;;
|
||||
+ powerpc64le-*linux*)
|
||||
+ LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
- ppc64-*linux*|powerpc64-*linux*)
|
||||
+ powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@@ -1366,7 +1362,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
- ppc*-*linux*|powerpc*-*linux*)
|
||||
+ powerpcle-*linux*)
|
||||
+ LD="${LD-ld} -m elf64lppc"
|
||||
+ ;;
|
||||
+ powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*|s390*-*tpf*)
|
||||
diff -rup sg3_utils-1.38.orig/configure sg3_utils-1.38/configure
|
||||
--- sg3_utils-1.38.orig/configure 2013-10-31 16:01:34.000000000 +0100
|
||||
+++ sg3_utils-1.38/configure 2014-04-18 15:13:21.000000000 +0200
|
||||
@@ -6122,7 +6125,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@@ -6138,16 +6141,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
|
||||
LD="${LD-ld} -m elf_i386_fbsd"
|
||||
;;
|
||||
x86_64-*linux*)
|
||||
- case `/usr/bin/file conftest.o` in
|
||||
- *x86-64*)
|
||||
- LD="${LD-ld} -m elf32_x86_64"
|
||||
- ;;
|
||||
- *)
|
||||
- LD="${LD-ld} -m elf_i386"
|
||||
- ;;
|
||||
- esac
|
||||
+ LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
- ppc64-*linux*|powerpc64-*linux*)
|
||||
+ powerpc64le-*linux*)
|
||||
+ LD="${LD-ld} -m elf32lppclinux"
|
||||
+ ;;
|
||||
+ powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@@ -6166,7 +6165,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
- ppc*-*linux*|powerpc*-*linux*)
|
||||
+ powerpcle-*linux*)
|
||||
+ LD="${LD-ld} -m elf64lppc"
|
||||
+ ;;
|
||||
+ powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*|s390*-*tpf*)
|
132
sg3_utils-1.42-sysmacros.patch
Normal file
132
sg3_utils-1.42-sysmacros.patch
Normal file
@ -0,0 +1,132 @@
|
||||
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
|
||||
index 76773fa..914570b 100644
|
||||
--- a/lib/sg_pt_linux.c
|
||||
+++ b/lib/sg_pt_linux.c
|
||||
@@ -18,8 +18,11 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/sysmacros.h> /* to define 'major' */
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
diff --git a/src/sg_dd.c b/src/sg_dd.c
|
||||
index 97a6f77..7bb5eed 100644
|
||||
--- a/src/sg_dd.c
|
||||
+++ b/src/sg_dd.c
|
||||
@@ -44,13 +44,15 @@
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#include <inttypes.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
-#include <sys/sysmacros.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/file.h>
|
||||
-#include <linux/major.h>
|
||||
+#include <sys/sysmacros.h>
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <linux/fs.h> /* <sys/mount.h> */
|
||||
+#include <linux/major.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
diff --git a/src/sg_map26.c b/src/sg_map26.c
|
||||
index 7739592..8e583d2 100644
|
||||
--- a/src/sg_map26.c
|
||||
+++ b/src/sg_map26.c
|
||||
@@ -33,8 +33,11 @@
|
||||
#include <dirent.h>
|
||||
#include <libgen.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/sysmacros.h> /* new location for major + minor */
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <linux/major.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
diff --git a/src/sg_read.c b/src/sg_read.c
|
||||
index 2cf8212..1eb0411 100644
|
||||
--- a/src/sg_read.c
|
||||
+++ b/src/sg_read.c
|
||||
@@ -36,9 +36,11 @@
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#include <inttypes.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
#include <linux/major.h>
|
||||
diff --git a/src/sg_xcopy.c b/src/sg_xcopy.c
|
||||
index 11206ac..49b4341 100644
|
||||
--- a/src/sg_xcopy.c
|
||||
+++ b/src/sg_xcopy.c
|
||||
@@ -47,11 +47,13 @@
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#include <inttypes.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
-#include <sys/sysmacros.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/file.h>
|
||||
+#include <sys/sysmacros.h>
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h> /* <sys/mount.h> */
|
||||
|
||||
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
|
||||
index 4e40acc..edf4861 100644
|
||||
--- a/src/sgm_dd.c
|
||||
+++ b/src/sgm_dd.c
|
||||
@@ -48,11 +48,13 @@
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#include <inttypes.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
-#include <sys/sysmacros.h>
|
||||
-#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
+#include <sys/mman.h>
|
||||
+#include <sys/sysmacros.h>
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h> /* <sys/mount.h> */
|
||||
|
||||
diff --git a/src/sgp_dd.c b/src/sgp_dd.c
|
||||
index 1ebecca..be9547b 100644
|
||||
--- a/src/sgp_dd.c
|
||||
+++ b/src/sgp_dd.c
|
||||
@@ -43,9 +43,11 @@
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#include <inttypes.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
+#ifndef major
|
||||
+#include <sys/types.h>
|
||||
+#endif
|
||||
#include <sys/time.h>
|
||||
#include <linux/major.h>
|
||||
#include <linux/fs.h> /* <sys/mount.h> */
|
@ -3,13 +3,16 @@
|
||||
Summary: Utilities for devices that use SCSI command sets
|
||||
Name: sg3_utils
|
||||
Version: 1.42
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
License: GPLv2+ and BSD
|
||||
Group: Applications/System
|
||||
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
|
||||
Source2: scsi-rescan.8
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=920687
|
||||
Patch0: sg3_utils-1.37-dont-open-dev-snapshot.patch
|
||||
# use sysmacros.h for major()/minor()
|
||||
# backported from https://github.com/hreinecke/sg3_utils/commit/3e50c99af4a446642c7055d1d06b84a94e4a76c2
|
||||
Patch1: sg3_utils-1.42-sysmacros.patch
|
||||
URL: http://sg.danny.cz/sg/sg3_utils.html
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
BuildRequires: gcc
|
||||
@ -48,6 +51,7 @@ developing applications.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .dev-snapshot
|
||||
%patch1 -p1 -b .sysmacros
|
||||
|
||||
|
||||
%build
|
||||
@ -85,6 +89,9 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 16 2018 Dan Horák <dan[at]danny.cz> - 1.42-6
|
||||
- fix build with new glibc - use sysmacros.h for major()/minor()
|
||||
|
||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user