Skip to content

Commit

Permalink
build(bugfix):pac sim elf ONLY in Linux platform
Browse files Browse the repository at this point in the history
avoid SIM compilation post build issues on other platforms
  • Loading branch information
xuxin930 committed Dec 25, 2024
1 parent 91ebf4f commit 5681f93
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions boards/sim/sim/sim/scripts/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,17 @@ else ifeq ($(CONFIG_HOST_MACOS),)
LDFLAGS += -Wl,-no-pie
endif

define POSTBUILD
$(Q)echo "Pac SIM with dynamic libs..";
@ rm -rf sim-pac;
@ mkdir -p sim-pac/libs;
@ cp nuttx sim-pac/nuttx;
@ ldd sim-pac/nuttx | grep "=> /" | awk '{print $$3}' | xargs -I '{}' cp -v '{}' sim-pac/libs;
@ readelf -l nuttx | grep "program interpreter" | awk -F':' '{print $$2}'| cut -d"]" -f1 | xargs -I '{}' cp -v '{}' sim-pac;
@ cp $(TOPDIR)/tools/simlaunch.sh sim-pac;
@ tar -czf nuttx.tgz sim-pac;
$(Q)echo "SIM elf with dynamic libs archive in nuttx.tgz"
@ rm -rf sim-pac;
endef
ifeq ($(CONFIG_HOST_LINUX),y)
define POSTBUILD
$(Q)echo "Pac SIM with dynamic libs..";
@ rm -rf sim-pac;
@ mkdir -p sim-pac/libs;
@ cp nuttx sim-pac/nuttx;
@ ldd sim-pac/nuttx | grep "=> /" | awk '{print $$3}' | xargs -I '{}' cp -v '{}' sim-pac/libs;
@ readelf -l nuttx | grep "program interpreter" | awk -F':' '{print $$2}'| cut -d"]" -f1 | xargs -I '{}' cp -v '{}' sim-pac;
@ cp $(TOPDIR)/tools/simlaunch.sh sim-pac;
@ tar -czf nuttx.tgz sim-pac;
$(Q)echo "SIM elf with dynamic libs archive in nuttx.tgz"
@ rm -rf sim-pac;
endef
endif

0 comments on commit 5681f93

Please sign in to comment.