summaryrefslogtreecommitdiffstats
path: root/rpm
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-03-06 09:17:24 -0800
committerGitHub <[email protected]>2017-03-06 09:17:24 -0800
commitfb963d33ee0dd350143ba1c9cd35d5f7d86910d2 (patch)
treebe973f1812a627ca6af088dea34230233272fdfc /rpm
parentebd9aa8c17596db4990979bb2f0df3f23d438115 (diff)
Fix powerpc build
Unlike other architectures which sanitize the LDFLAGS from the environment in arch/<arch>/Makefile. The powerpc Makefile allows LDFLAGS to be passed through resulting in the following build failure. /usr/bin/ld: unrecognized option '-Wl,-z,relro' LDFLAGS is set in /usr/lib/rpm/redhat/macros by default. Clear the environment variable when building kmods for powerpc. Additionally, now that ppc64le exists it's not longer safe to assume a powerpc system is big endian. Rely on the endianness provided by the compiler. Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5856
Diffstat (limited to 'rpm')
-rw-r--r--rpm/generic/zfs-kmod.spec.in5
-rw-r--r--rpm/redhat/zfs-kmod.spec.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in
index 9d10e6075..b635e6ea7 100644
--- a/rpm/generic/zfs-kmod.spec.in
+++ b/rpm/generic/zfs-kmod.spec.in
@@ -86,6 +86,11 @@ BuildRequires: kmod-spl-devel = %{version}
%global KmodsMetaRequires spl-kmod
%endif
+# LDFLAGS are not sanitized by arch/powerpc/Makefile (unlike other arches)
+%ifarch ppc ppc64 ppc64le
+%global __global_ldflags %{nil}
+%endif
+
%if 0%{?fedora} >= 17
%define prefix /usr
%endif
diff --git a/rpm/redhat/zfs-kmod.spec.in b/rpm/redhat/zfs-kmod.spec.in
index fa0c1108e..ae7e95d63 100644
--- a/rpm/redhat/zfs-kmod.spec.in
+++ b/rpm/redhat/zfs-kmod.spec.in
@@ -21,6 +21,11 @@ Requires: spl-kmod\n\
Requires: @PACKAGE@ = %{version}\n\
Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
+# LDFLAGS are not sanitized by arch/powerpc/Makefile (unlike other arches)
+%ifarch ppc ppc64 ppc64le
+%global __global_ldflags %{nil}
+%endif
+
%description
This package contains the ZFS kernel modules.