From 6bd90c614b3ce3a2bf7f70bc2900e90ecc9ab116 Mon Sep 17 00:00:00 2001 From: Pete Swain Date: Fri, 3 Jun 2022 18:40:39 -0700 Subject: [PATCH] PRODKERNEL: strip multiple kpatch-cc prefixes For debugging kpatch-build, cope with a confused state where the kpatch-cc prefix is applied twice. When stable this should not happen, and should be complained of. While developing, just peel them off Tested: with later commits Upstream-Plan: 190514358 Signed-off-by: Pete Swain --- kpatch-build/kpatch-cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kpatch-build/kpatch-cc b/kpatch-build/kpatch-cc index e7e99ec36..19fddaf9f 100755 --- a/kpatch-build/kpatch-cc +++ b/kpatch-build/kpatch-cc @@ -4,6 +4,12 @@ if [[ ${KPATCH_GCC_DEBUG:-0} -ne 0 ]]; then set -o xtrace fi +# cope with multiply-prefixed invocation +while [[ "$1" =~ /kpatch-cc$ ]]; do + echo >&2 kpatch-cc: stuttered prefix + shift +done + TOOLCHAINCMD="$1" shift