aboutsummaryrefslogtreecommitdiff
path: root/makefiles
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
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')
-rw-r--r--makefiles/firmware.mk2
-rw-r--r--makefiles/toolchain_gnu-arm-eabi.mk15
2 files changed, 16 insertions, 1 deletions
diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk
index 6fa0ae3eb..7afa3e787 100644
--- a/makefiles/firmware.mk
+++ b/makefiles/firmware.mk
@@ -280,7 +280,7 @@ ifeq ($(ROMFS_FILES),)
$(error ROMFS_ROOT $(ROMFS_ROOT) specifies a directory containing no files)
endif
ROMFS_DEPS += $(ROMFS_FILES)
-ROMFS_IMG = $(WORK_DIR)romfs.img
+ROMFS_IMG = romfs.img
ROMFS_CSRC = $(ROMFS_IMG:.img=.c)
ROMFS_OBJ = $(ROMFS_CSRC:.c=.o)
LIBS += $(ROMFS_OBJ)
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