From c9b6743b7dc97674555a449d06d4bcaa32fbbb5d Mon Sep 17 00:00:00 2001 From: Ella Fox Date: Wed, 23 Oct 2024 20:56:07 +0200 Subject: [PATCH] Makefile: Fix macOS cross-compilation On macOS, the clang compiler is the default for C++ sources. Therefore, we also require the CROSS_PREFIX to be set here as well. This updates the Makefile, but also fixes the check-gcc script, so that it understands we are cross compiling with the prefixed readelf binary. Signed-off-by: Ella Fox --- Makefile | 2 +- scripts/check-gcc.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 22ccc97..ad60081 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ LD=$(CROSS_PREFIX)ld OBJCOPY=$(CROSS_PREFIX)objcopy OBJDUMP=$(CROSS_PREFIX)objdump STRIP=$(CROSS_PREFIX)strip -CPP=cpp +CPP=$(CROSS_PREFIX)cpp PYTHON=python3 # Source files diff --git a/scripts/check-gcc.sh b/scripts/check-gcc.sh index 2d89d98..7014d50 100755 --- a/scripts/check-gcc.sh +++ b/scripts/check-gcc.sh @@ -4,8 +4,8 @@ f1="$1" f2="$2" -s1=`readelf -A "$f1" | grep "Tag_ARM_ISA_use"` -s2=`readelf -A "$f2" | grep "Tag_ARM_ISA_use"` +s1=`${CROSS_PREFIX}readelf -A "$f1" | grep "Tag_ARM_ISA_use"` +s2=`${CROSS_PREFIX}readelf -A "$f2" | grep "Tag_ARM_ISA_use"` if [ "$s1" != "$s2" ]; then echo ""