diff --git a/pie/Makefile b/pie/Makefile index e912ab425..52e5eb006 100644 --- a/pie/Makefile +++ b/pie/Makefile @@ -38,7 +38,7 @@ $(obj)/%.built-in.bin: $(obj)/%.built-in.bin.o $(obj)/%-blob.h: $(obj)/%.built-in.bin $(obj)/$(GEN-OFFSETS) $(E) " GEN " $@ - $(Q) $(SH) $(obj)/$(GEN-OFFSETS) $(@:-blob.h=) $(notdir $(@:-blob.h=)) > $@ + $(Q) $(SH) $(obj)/$(GEN-OFFSETS) $(@:-blob.h=) $(notdir $(@:-blob.h=)) $(CROSS_COMPILE) > $@ $(BLOBS): $(obj)/$(PIELDS) _all += $(BLOBS) diff --git a/pie/gen-offsets.sh b/pie/gen-offsets.sh index 99af519d1..f5e3df290 100644 --- a/pie/gen-offsets.sh +++ b/pie/gen-offsets.sh @@ -5,6 +5,13 @@ set -u FILE=$1 NAME=$2 + +if test $# -ge 3; then +CROSS_COMPILE=$3 +else +CROSS_COMPILE= +fi + INC_GUARD=__${NAME}_h__ PREFIX=${NAME}_blob_offset__ BLOB=${NAME}_blob @@ -20,7 +27,7 @@ cat << EOF EOF -nm $OBJNAME | grep "__export_" | tr . _ | awk "$AWK_CMD" +${CROSS_COMPILE}nm $OBJNAME | grep "__export_" | tr . _ | awk "$AWK_CMD" cat << EOF