From 7dcd7c9405244f8de92c69717a6dc2cacd90e1d4 Mon Sep 17 00:00:00 2001 From: Pete Swain Date: Thu, 26 May 2022 01:39:48 -0700 Subject: [PATCH] simplify CC/LD patterns Signed-off-by: Pete Swain --- kpatch-build/kpatch-cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpatch-build/kpatch-cc b/kpatch-build/kpatch-cc index 00247c957..e7e99ec36 100755 --- a/kpatch-build/kpatch-cc +++ b/kpatch-build/kpatch-cc @@ -13,7 +13,7 @@ fi declare -a args=("$@") -if [[ "$TOOLCHAINCMD" =~ ^(.*-)?gcc$ || "$TOOLCHAINCMD" =~ ^(.*-)?clang$ ]] ; then +if [[ "$TOOLCHAINCMD" =~ ^(.*[-/])?(gcc|clang)$ ]] ; then while [ "$#" -gt 0 ]; do if [ "$1" = "-o" ]; then obj="$2" @@ -65,7 +65,7 @@ if [[ "$TOOLCHAINCMD" =~ ^(.*-)?gcc$ || "$TOOLCHAINCMD" =~ ^(.*-)?clang$ ]] ; th fi shift done -elif [[ "$TOOLCHAINCMD" =~ ^(.*-)?ld || "$TOOLCHAINCMD" =~ ^(.*-)?ld.lld ]] ; then + elif [[ "$TOOLCHAINCMD" =~ ^(.*[-/])?ld(\.(ldd|bfd))?$ ]] ; then while [ "$#" -gt 0 ]; do if [ "$1" = "-o" ]; then obj="$2"