diff --git a/SOURCES/libtool-handle-ppc64le.sh b/SOURCES/libtool-handle-ppc64le.sh new file mode 100644 index 0000000..c012de4 --- /dev/null +++ b/SOURCES/libtool-handle-ppc64le.sh @@ -0,0 +1,135 @@ +#!/bin/bash + +# Date: April 2, 2014 +# by Aldy Hernandez + +# Attempt to fix any "-m elf64ppc" linker checks in configure and +# libtool.m4 files. +# +# This script is meant to run silently as part of rpm's %configure +# macro. It either fixes the problem, or we silently ignore it, in +# which case it is up to the package maintainer to add support for +# ppc64le. + +# Our two attempts at fixing the problem. +PATCH1=/tmp/$$.patch1 +PATCH2=/tmp/$$.patch2 + +cleanup() { + rm -f $PATCH1 $PATCH2 +} + +trap cleanup 0 1 2 3 4 5 6 7 8 9 11 13 14 15 + +# There are two variants in RHEL7 so far. The first version, handled +# with $PATCH1, currently handles all but 3 packages. The $PATCH2 +# version handles the remnant. +# +cat > $PATCH1 < $PATCH2 </dev/null; then + continue + fi + + # Filter out candidates that don't handle PPC. + if ! grep -s -e '-m elf64ppc' $f >/dev/null; then + continue + fi + + echo "Broken -m elf64ppc use in $f should handle elf64lppc." + echo "Attempting automatic fix." + + # Attempt to fix the offended file. + basename=`basename $f` + dirname=`dirname $f` + for p in $PATCH1 $PATCH2; do + # This is an all for nothing affair. The patch either + # applies entirely clean, or we don't even try. + # + # Tentatively try either patch cleanly, and if we succeed then + # do it for real. + pushd $dirname 2>&1 > /dev/null + if [ $basename = libtool.m4 ]; then + sed s/configure/libtool.m4/ < $p | patch --dry-run --follow-symlinks -l 2>&1 >/dev/null + else + patch --dry-run --follow-symlinks -l < $p 2>&1 > /dev/null + fi + if [ $? != 0 ]; then + echo -n "$p approach did not work for $dirname/$basename: " + pwd + # This approach didn't work, try the next one. + popd 2>&1 > /dev/null + continue + fi + + # Seriously now... + if [ $basename = libtool.m4 ]; then + # Save the timestamp. + cp -p $basename /tmp/tmp.$$ + sed s/configure/libtool.m4/ < $p | patch --follow-symlinks -l -s 2>&1 > /dev/null + # Use the old timestamp, to avoid anyone noticing changes + # to libtool.m4. + touch --reference=/tmp/tmp.$$ $basename + rm -f /tmp/tmp.$$ + else + patch --follow-symlinks -l -s < $p 2>&1 > /dev/null + fi + echo "Fixed $f for ld -m ppc64le support." + popd 2>&1 > /dev/null + break + done +done + +rm -f $PATCH1 $PATCH2 diff --git a/SOURCES/redhat-rpm-config-9.1.0-aarch64.patch b/SOURCES/redhat-rpm-config-9.1.0-aarch64.patch index 03456d2..a53fbbb 100644 --- a/SOURCES/redhat-rpm-config-9.1.0-aarch64.patch +++ b/SOURCES/redhat-rpm-config-9.1.0-aarch64.patch @@ -6,7 +6,7 @@ index 9127200..fe2f84b 100644 optflags: s390 %{__global_cflags} -m31 -march=z9-109 -mtune=z10 optflags: s390x %{__global_cflags} -m64 -march=z9-109 -mtune=z10 -+optflags: aarch64 %{__global_cflags} -fno-stack-protector ++optflags: aarch64 %{__global_cflags} + # set build arch to fedora buildarches on hardware capable of running it # saves having to do rpmbuild --target= diff --git a/SOURCES/redhat-rpm-config-9.1.0-centos.dist.patch b/SOURCES/redhat-rpm-config-9.1.0-centos.dist.patch deleted file mode 100644 index bdb0ee2..0000000 --- a/SOURCES/redhat-rpm-config-9.1.0-centos.dist.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNrp redhat-rpm-config-9.1.0.orig/dist.sh redhat-rpm-config-9.1.0/dist.sh ---- redhat-rpm-config-9.1.0.orig/dist.sh 2010-02-02 03:24:04.000000000 -0600 -+++ redhat-rpm-config-9.1.0/dist.sh 2014-06-19 09:29:04.064790458 -0500 -@@ -25,7 +25,7 @@ function check_rhl { - } - - function check_rhel { -- egrep -q "(Enterprise|Advanced)" $RELEASEFILE && echo $DISTNUM -+ egrep -q "(Enterprise|Advanced|CentOS)" $RELEASEFILE && echo $DISTNUM - } - - function check_fedora { diff --git a/SOURCES/redhat-rpm-config-9.1.0-fix-kabi-path.patch b/SOURCES/redhat-rpm-config-9.1.0-fix-kabi-path.patch new file mode 100644 index 0000000..cdfff27 --- /dev/null +++ b/SOURCES/redhat-rpm-config-9.1.0-fix-kabi-path.patch @@ -0,0 +1,12 @@ +diff -Nuar redhat-rpm-config-9.1.0_bak/find-requires.ksyms redhat-rpm-config-9.1.0/find-requires.ksyms +--- redhat-rpm-config-9.1.0_bak/find-requires.ksyms 2014-11-12 02:24:19.883051779 -0500 ++++ redhat-rpm-config-9.1.0/find-requires.ksyms 2014-11-12 02:24:35.005003931 -0500 +@@ -45,7 +45,7 @@ + + check_kabi() { + arch=$(uname -m) +- kabi_file="/lib/modules/kabi/kabi_whitelist_$arch" ++ kabi_file="/lib/modules/kabi-current/kabi_whitelist_$arch" + + # If not installed, output a warning and return (continue) + if [ ! -f "$kabi_file" ]; then diff --git a/SOURCES/redhat-rpm-config-9.1.0-ppc64le.patch b/SOURCES/redhat-rpm-config-9.1.0-ppc64le.patch new file mode 100644 index 0000000..479896d --- /dev/null +++ b/SOURCES/redhat-rpm-config-9.1.0-ppc64le.patch @@ -0,0 +1,31 @@ +--- ./redhat-rpm-config-9.1.0/macros.orig 2014-04-03 14:16:43.268991281 -0500 ++++ ./redhat-rpm-config-9.1.0/macros 2014-04-03 14:16:49.720110279 -0500 +@@ -24,6 +24,10 @@ + %_enable_debug_packages 1 + %_include_minidebuginfo 1 + ++# Set to enforce patching libtool.m4 and associated configure files ++# to handle ppc64le. ++%_libtool_ppc64le_fix 1 ++ + #============================================================================== + # ---- configure and makeinstall. + # +@@ -34,6 +36,7 @@ + FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \ + FCFLAGS="${FCFLAGS:-%optflags -I%_fmoddir}" ; export FCFLAGS ; \ + LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; \ ++ [ "%_libtool_ppc64le_fix" == 1 ] && [ "%_arch" == ppc64le ] && /usr/lib/rpm/redhat/libtool-handle-ppc64le.sh ; \ + for i in $(find . -name config.guess -o -name config.sub) ; do \ + [ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \ + done ; \ +--- ./redhat-rpm-config-9.1.0/rpmrc.orig 2014-04-07 14:11:22.818988723 -0700 ++++ ./redhat-rpm-config-9.1.0/rpmrc 2014-04-07 14:16:50.407258196 -0700 +@@ -28,6 +28,7 @@ + optflags: ppciseries %{__global_cflags} -m32 + optflags: ppcpseries %{__global_cflags} -m32 + optflags: ppc64 %{__global_cflags} -m64 -mcpu=power7 -mtune=power7 ++optflags: ppc64le %{__global_cflags} -m64 -mcpu=power7 -mtune=power8 + optflags: ppc64iseries %{__global_cflags} -m64 + optflags: ppc64pseries %{__global_cflags} -m64 + optflags: ppc8260 %{__global_cflags} -m32 diff --git a/SOURCES/redhat-rpm-config-9.1.0-rhel7-arch-optflags.patch b/SOURCES/redhat-rpm-config-9.1.0-rhel7-arch-optflags.patch index 3cf1c8d..337999f 100644 --- a/SOURCES/redhat-rpm-config-9.1.0-rhel7-arch-optflags.patch +++ b/SOURCES/redhat-rpm-config-9.1.0-rhel7-arch-optflags.patch @@ -32,5 +32,5 @@ diff -up redhat-rpm-config-9.1.0/rpmrc.arch-optflags redhat-rpm-config-9.1.0/rpm +optflags: s390 %{__global_cflags} -m31 -march=z196 -mtune=zEC12 +optflags: s390x %{__global_cflags} -m64 -march=z196 -mtune=zEC12 - optflags: aarch64 %{__global_cflags} -fno-stack-protector + optflags: aarch64 %{__global_cflags} diff --git a/SPECS/redhat-rpm-config.spec b/SPECS/redhat-rpm-config.spec index 70d83c4..5969b7c 100644 --- a/SPECS/redhat-rpm-config.spec +++ b/SPECS/redhat-rpm-config.spec @@ -1,7 +1,7 @@ -Summary: CentOS specific rpm configuration files +Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config Version: 9.1.0 -Release: 63%{?dist} +Release: 68%{?dist} # No version specified. License: GPL+ Group: Development/System @@ -20,6 +20,9 @@ Source11: config.sub Source20: kabi.attr Source21: kabi.sh +# Script to handle ppc64le in libtool and associated configure files. +Source30: libtool-handle-ppc64le.sh + Patch0: redhat-rpm-config-9.1.0-strict-python-bytecompile.patch Patch1: redhat-rpm-config-9.1.0-fix-requires.patch Patch2: redhat-rpm-config-9.1.0-no-strip-note.patch @@ -78,8 +81,10 @@ Patch29: redhat-rpm-config-9.1.0-stackprotector-strong.patch Patch30: redhat-rpm-config-9.1.0-perfbuild.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1049175 Patch31: redhat-rpm-config-9.1.0-use-kverrel-for-kmodtool.patch - -Patch999: redhat-rpm-config-9.1.0-centos.dist.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1126086 +Patch32: redhat-rpm-config-9.1.0-fix-kabi-path.patch +# ppc64 little endian support +Patch99: redhat-rpm-config-9.1.0-ppc64le.patch BuildArch: noarch Requires: coreutils @@ -90,7 +95,7 @@ Requires: zip Provides: system-rpm-config = %{version}-%{release} %description -CentOS specific rpm configuration files. +Red Hat specific rpm configuration files. %prep %setup -q @@ -126,8 +131,9 @@ CentOS specific rpm configuration files. %patch29 -p1 %patch30 -p1 %patch31 -p1 +%patch32 -p1 -%patch999 -p1 +%patch99 -p2 %build @@ -135,6 +141,7 @@ CentOS specific rpm configuration files. make DESTDIR=${RPM_BUILD_ROOT} install install -m 0444 %{SOURCE1} %{SOURCE2} ${RPM_BUILD_ROOT}/usr/lib/rpm/redhat install -m 0755 %{SOURCE10} %{SOURCE11} ${RPM_BUILD_ROOT}/usr/lib/rpm/redhat +install -m 0755 %{SOURCE30} ${RPM_BUILD_ROOT}/usr/lib/rpm/redhat install -D -m 0644 %{SOURCE20} ${RPM_BUILD_ROOT}/usr/lib/rpm/fileattrs/kabi.attr install -m 0755 %{SOURCE21} ${RPM_BUILD_ROOT}/usr/lib/rpm/kabi.sh @@ -155,9 +162,21 @@ rm -rf ${RPM_BUILD_ROOT} %{_sysconfdir}/rpm/* %changelog -* Thu Jun 19 2014 Johnny Hughes - 9.1.0-61.el7.centos -- Roll in Patch999 for CentOS Branding -- Make SPEC file changes for CentOS Branding +* Wed Nov 12 2014 Weiping Pan - 9.1.0-68 +- fix kabi path (#1126086) + +* Tue Aug 12 2014 Panu Matilainen - 9.1.0-67 +- Enable stack protector on aarch64 (#1073677) + +* Fri Aug 01 2014 Florian Festi - 9.1.0-66 +- use -mtune=power8 for ppc64le (#1123485) + +* Fri Jul 25 2014 Florian Festi - 9.1.0-65 +- Fix fix for ppc64le libtool issues (#1113618) +- As this package is noarch we need to have a runtime solution + +* Thu Jul 24 2014 Florian Festi - 9.1.0-64 +- Fix ppc64le libtool issues (#1113618) * Tue Feb 18 2014 Weiping Pan - 9.1.0-61 - use kverrel as the parameter for kmodtool (#1049175)