Skip to content

Commit

Permalink
Makefile: Fix macOS cross-compilation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
EllaFoxo committed Oct 23, 2024
1 parent 90eb71b commit c9b6743
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down

0 comments on commit c9b6743

Please sign in to comment.