Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5856
  • Loading branch information
behlendorf committed Mar 6, 2017
1 parent ebd9aa8 commit fb963d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/libspl/include/sys/isa_defs.h
Expand Up @@ -98,10 +98,6 @@ extern "C" {
#endif
#endif

#if !defined(_BIG_ENDIAN)
#define _BIG_ENDIAN
#endif

#define _SUNOS_VTOC_16

/* arm arch specific defines */
Expand Down
5 changes: 5 additions & 0 deletions rpm/generic/zfs-kmod.spec.in
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions rpm/redhat/zfs-kmod.spec.in
Expand Up @@ -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.

Expand Down

0 comments on commit fb963d3

Please sign in to comment.