os/Makefile.unix: Verify undefined symbols in common binary
Check for undefined symbols in common binary and print error message.
@@ -464,6 +464,12 @@ ifeq ($(CONFIG_BUILD_2PASS),y)
$(Q) $(MAKE) -C $(LOADABLE_APPDIR) TOPDIR="$(TOPDIR)" LOADABLEDIR="${LOADABLE_APPDIR}" LIBRARIES_DIR="$(LIBRARIES_DIR)" USERLIBS="$(USERLIBS)" all KERNEL=n
ifeq ($(CONFIG_SUPPORT_COMMON_BINARY),y)
$(Q) $(LD) -r -o $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME) -T $(TOPDIR)/binfmt/libelf/gnu-elf.ld -L $(LIBRARIES_DIR) --start-group $(COMMONLIBS) $(LIBGCC) --end-group $$(cat $(OUTBIN_DIR)/lib_symbols.txt)
+ $(Q) if [ "`nm -u $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME) | wc -l`" != "0" ]; then \
+ echo "Undefined Symbols in Common binary"; \
+ nm -u -l $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME); \
+ rm $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME); \
+ exit 1; \
+ fi
$(Q) $(STRIP) -g -o $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME) $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME)
$(Q) $(OBJCOPY) --remove-section .comment $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME)
endif
