kpatch-build: PPC64le - gcc profiling support check

gcc -mprofile-kernel support is required on ppc64le for livepatch
to work. Check should be performed on the gcc, instead of relying
on the verion number.

This check is already performed during the kernel build by:
<linux-sources>/arch/poweprc/tools/gcc-check-mprofile-kernel.sh
Bail out, during the kernel build. Incase the gcc lacks the support
for -mprofile-kernel, instead of duplicating the check in kpatch-buid.

Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
This commit is contained in:
Kamalesh Babulal 2017-07-10 00:05:10 -04:00
parent dde4e95fa4
commit 665c2222ce

View File

@ -36,6 +36,7 @@
BASE="$PWD"
SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
ARCH="$(uname -m)"
ARCHVERSION="$(uname -r)"
CPUS="$(getconf _NPROCESSORS_ONLN)"
CACHEDIR="${CACHEDIR:-$HOME/.kpatch}"
@ -158,11 +159,21 @@ gcc_version_check() {
return 1
fi
# ensure gcc version is >= 4.8
gccver=$(echo $gccver |cut -d'.' -f1,2)
if [[ $gccver < 4.8 ]]; then
warn "gcc >= 4.8 required"
return 1
# On ppc64le, livepatch relies on gcc support for -mprofile-kernel flag.
# Script with differnet checks is run during kernel build, to ensure that
# the required gcc supports is available. This check is done during kernel
# build by:
# <linux-sources>/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
# Postpond the check until kernel build, instead of duplicating it here.
if [[ $ARCH = "ppc64le" ]]; then
return
else
# ensure gcc version is >= 4.8
gccver=$(echo $gccver |cut -d'.' -f1,2)
if [[ $gccver < 4.8 ]]; then
warn "gcc >= 4.8 required"
return 1
fi
fi
return