From e0aacd9b9767a877ad61b74cf87c0da856bb1e8a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 6 Mar 2017 09:16:22 -0800 Subject: [PATCH] Fix powerpc build Unlike other architectures which sanitize the LDFLAGS from the environment in 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. Reviewed-by: Giuseppe Di Natale Signed-off-by: Brian Behlendorf Closes #607 --- rpm/generic/spl-kmod.spec.in | 5 +++++ rpm/redhat/spl-kmod.spec.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/rpm/generic/spl-kmod.spec.in b/rpm/generic/spl-kmod.spec.in index 11d23fb..6a4be7a 100644 --- a/rpm/generic/spl-kmod.spec.in +++ b/rpm/generic/spl-kmod.spec.in @@ -53,6 +53,11 @@ BuildRequires: %{_bindir}/kmodtool %endif %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/spl-kmod.spec.in b/rpm/redhat/spl-kmod.spec.in index 6fcc4a8..cab72a7 100644 --- a/rpm/redhat/spl-kmod.spec.in +++ b/rpm/redhat/spl-kmod.spec.in @@ -22,6 +22,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -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 kernel modules required to emulate several interfaces provided by the Solaris kernel. -- 2.39.2