HOTFIX: simplify symbol names going into the ROMFS object, hopefully this avoids inconsistent symbol naming on Windows.

This commit is contained in:
px4dev 2013-05-12 14:04:57 -07:00
parent 0ee738e9c9
commit edb0e01dfd
3 changed files with 23 additions and 3 deletions

View File

@ -159,11 +159,11 @@ $(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC) $(NUTTX_APPS)
.PHONY: clean .PHONY: clean
clean: clean:
$(Q) $(RMDIR) $(BUILD_DIR)*.build $(Q) $(RMDIR) $(BUILD_DIR)*.build
$(Q) $(REMOVE) -f $(IMAGE_DIR)*.px4 $(Q) $(REMOVE) $(IMAGE_DIR)*.px4
.PHONY: distclean .PHONY: distclean
distclean: clean distclean: clean
$(Q) $(REMOVE) -f $(ARCHIVE_DIR)*.export $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export
$(Q) make -C $(NUTTX_SRC) -r $(MQUIET) distclean $(Q) make -C $(NUTTX_SRC) -r $(MQUIET) distclean
# #
@ -196,6 +196,11 @@ help:
@echo " distclean" @echo " distclean"
@echo " Remove all compilation products, including NuttX RTOS archives." @echo " Remove all compilation products, including NuttX RTOS archives."
@echo "" @echo ""
@echo " upload"
@echo " When exactly one config is being built, add this target to upload the"
@echo " firmware to the board when the build is complete. Not supported for"
@echo " all configurations."
@echo ""
@echo " Common options:" @echo " Common options:"
@echo " ---------------" @echo " ---------------"
@echo "" @echo ""

View File

@ -280,7 +280,7 @@ ifeq ($(ROMFS_FILES),)
$(error ROMFS_ROOT $(ROMFS_ROOT) specifies a directory containing no files) $(error ROMFS_ROOT $(ROMFS_ROOT) specifies a directory containing no files)
endif endif
ROMFS_DEPS += $(ROMFS_FILES) ROMFS_DEPS += $(ROMFS_FILES)
ROMFS_IMG = $(WORK_DIR)romfs.img ROMFS_IMG = romfs.img
ROMFS_CSRC = $(ROMFS_IMG:.img=.c) ROMFS_CSRC = $(ROMFS_IMG:.img=.c)
ROMFS_OBJ = $(ROMFS_CSRC:.c=.o) ROMFS_OBJ = $(ROMFS_CSRC:.c=.o)
LIBS += $(ROMFS_OBJ) LIBS += $(ROMFS_OBJ)

View File

@ -254,6 +254,20 @@ endef
# - relink the object and insert the binary file # - relink the object and insert the binary file
# - edit symbol names to suit # - 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 define BIN_SYM_PREFIX
_binary_$(subst /,_,$(subst .,_,$1)) _binary_$(subst /,_,$(subst .,_,$1))
endef 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)_start=$3 \
--redefine-sym $(call BIN_SYM_PREFIX,$1)_size=$3_len \ --redefine-sym $(call BIN_SYM_PREFIX,$1)_size=$3_len \
--strip-symbol $(call BIN_SYM_PREFIX,$1)_end --strip-symbol $(call BIN_SYM_PREFIX,$1)_end
$(Q) $(REMOVE) $2.c $2.c.o
endef endef