Skip to content

Commit

Permalink
simplify CC/LD patterns
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Swain <[email protected]>
  • Loading branch information
swine committed Sep 17, 2022
1 parent 5a8e136 commit 2b44b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kpatch-build/kpatch-cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2b44b35

Please sign in to comment.