From ac9a50c7a3aec953829650a0f76b884bb0d1340e Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Mon, 8 Aug 2022 19:40:11 -0400 Subject: [PATCH] Support AArch64 in bad_build_check (#8188) * Support AArch64 in bad_build_check Related: #8164 * UNdo uneeded --- infra/base-images/base-runner/bad_build_check | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/infra/base-images/base-runner/bad_build_check b/infra/base-images/base-runner/bad_build_check index bb328c793..b3126a508 100755 --- a/infra/base-images/base-runner/bad_build_check +++ b/infra/base-images/base-runner/bad_build_check @@ -306,22 +306,18 @@ function check_mixed_sanitizers { return 0 fi - if [[ $ARCHITECTURE == 'i386' ]] + if [[ $ARCHITECTURE == "x86_64" ]] + then + CALL_INSN="callq\s+[0-9a-f]+\s+<" + elif [[ $ARCHITECTURE == "i386" ]] then CALL_INSN="call\s+[0-9a-f]+\s+<" + elif [[ $ARCHITECTURE == "aarch64" ]] + then + CALL_INSN="bl\s+[0-9a-f]+\s+<" else - case $(uname -m) in - x86_64) - CALL_INSN="callq?\s+[0-9a-f]+\s+<" - ;; - aarch64) - CALL_INSN="bl\s+[0-9a-f]+\s+<" - ;; - *) - echo "Error: unsupported machine hardware $(uname -m)" - exit 1 - ;; - esac + echo "UNSUPPORTED ARCHITECTURE" + exit 1 fi local ASAN_CALLS=$(objdump -dC $FUZZER | egrep "${CALL_INSN}__asan" -c) local DFSAN_CALLS=$(objdump -dC $FUZZER | egrep "${CALL_INSN}__dfsan" -c) @@ -397,6 +393,9 @@ function check_architecture { elif [[ $ARCHITECTURE == "i386" ]] then echo $FILE_OUTPUT | grep "80386" > /dev/null + elif [[ $ARCHITECTURE == "aarch64" ]] + then + echo $FILE_OUTPUT | grep "aarch64" > /dev/null else echo "UNSUPPORTED ARCHITECTURE" return 1