From 4f86ef968dba6dd3ad5c3398e67ca61bf86925b7 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 30 May 2013 17:11:50 +0400 Subject: [PATCH] make: pie -- Use CROSS_COMPILE prefix for nm utility Signed-off-by: Cyrill Gorcunov CC: Chanho Park CC: Myungjoo Ham Acked-by: Chanho Park Signed-off-by: Pavel Emelyanov --- pie/Makefile | 2 +- pie/gen-offsets.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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