aboutsummaryrefslogtreecommitdiff
path: root/makefiles/toolchain_gnu-arm-eabi.mk
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-05-12 14:04:57 -0700
committerpx4dev <px4@purgatory.org>2013-05-12 14:04:57 -0700
commitedb0e01dfd9c38b826ec038ff7b8387e8ce0bd21 (patch)
tree1926a854cb700892c311000465b27dc91e4abf1f /makefiles/toolchain_gnu-arm-eabi.mk
parent0ee738e9c91c49739798ac5ff8dd4a12c06bb82f (diff)
downloadpx4-firmware-edb0e01dfd9c38b826ec038ff7b8387e8ce0bd21.tar.gz
px4-firmware-edb0e01dfd9c38b826ec038ff7b8387e8ce0bd21.tar.bz2
px4-firmware-edb0e01dfd9c38b826ec038ff7b8387e8ce0bd21.zip
HOTFIX: simplify symbol names going into the ROMFS object, hopefully this avoids inconsistent symbol naming on Windows.
Diffstat (limited to 'makefiles/toolchain_gnu-arm-eabi.mk')
-rw-r--r--makefiles/toolchain_gnu-arm-eabi.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk
index 0e651e53c..874e7154c 100644
--- a/makefiles/toolchain_gnu-arm-eabi.mk
+++ b/makefiles/toolchain_gnu-arm-eabi.mk
@@ -254,6 +254,20 @@ endef
# - relink the object and insert the binary file
# - edit symbol names to suit
#
+# NOTE: exercise caution using this with absolute pathnames; it looks
+# like the MinGW tools insert an extra _ in the binary symbol name; e.g.
+# the path:
+#
+# /d/px4/firmware/Build/px4fmu_default.build/romfs.img
+#
+# is assigned symbols like:
+#
+# _binary_d__px4_firmware_Build_px4fmu_default_build_romfs_img_size
+#
+# when we would expect
+#
+# _binary__d_px4_firmware_Build_px4fmu_default_build_romfs_img_size
+#
define BIN_SYM_PREFIX
_binary_$(subst /,_,$(subst .,_,$1))
endef
@@ -267,4 +281,5 @@ define BIN_TO_OBJ
--redefine-sym $(call BIN_SYM_PREFIX,$1)_start=$3 \
--redefine-sym $(call BIN_SYM_PREFIX,$1)_size=$3_len \
--strip-symbol $(call BIN_SYM_PREFIX,$1)_end
+ $(Q) $(REMOVE) $2.c $2.c.o
endef