1
0
Fork 0
forked from nuttx/nuttx-update

build(bugfix):pac sim elf ONLY in Linux platform

avoid SIM compilation post build issues on other platforms

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2024-11-15 10:39:17 +08:00 committed by Xiang Xiao
parent f2949f84a3
commit 71b169e5fd

View file

@ -330,15 +330,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