unified: Fix build broblem caused by concurrent make processes in single dir
Make sure that kernel/unified, that is included in libs-y does not built recursively through building kernel/ directory. Make sure that any lib.a library is not included into libzephyr.a and thus object modules from those lib.a files are linked only if a function from that object module is referenced from the application. Jira: ZEP-1025 Change-Id: Id3a3e96ca0b8abc9aedde0ffb9baa0164e380464 Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This commit is contained in:
parent
d846dd1fcd
commit
19f2884738
2 changed files with 9 additions and 9 deletions
14
Makefile
14
Makefile
|
@ -534,8 +534,6 @@ scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
|
||||||
|
|
||||||
# arch/ must be last here so that .gnu.linkonce magic for interrupts/exceptions
|
# arch/ must be last here so that .gnu.linkonce magic for interrupts/exceptions
|
||||||
# works as expected
|
# works as expected
|
||||||
core-y := lib/ kernel/ misc/ net/ boards/ ext/ usb/ fs/ tests/ arch/
|
|
||||||
drivers-y := drivers/
|
|
||||||
|
|
||||||
ifneq ($(strip $(MAKEFILE_APP_DIR)),)
|
ifneq ($(strip $(MAKEFILE_APP_DIR)),)
|
||||||
MAKEFILE_APP := $(realpath $(MAKEFILE_APP_DIR)/Makefile.app)
|
MAKEFILE_APP := $(realpath $(MAKEFILE_APP_DIR)/Makefile.app)
|
||||||
|
@ -580,7 +578,11 @@ endif # $(dot-config)
|
||||||
# Unified kernel objects are built as a static library
|
# Unified kernel objects are built as a static library
|
||||||
ifeq ($(CONFIG_KERNEL_V2),y)
|
ifeq ($(CONFIG_KERNEL_V2),y)
|
||||||
libs-y := kernel/unified/
|
libs-y := kernel/unified/
|
||||||
|
core-y := lib/ misc/ net/ boards/ ext/ usb/ fs/ tests/ arch/
|
||||||
|
else
|
||||||
|
core-y := lib/ kernel/ misc/ net/ boards/ ext/ usb/ fs/ tests/ arch/
|
||||||
endif
|
endif
|
||||||
|
drivers-y := drivers/
|
||||||
|
|
||||||
ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
|
ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
|
||||||
export ARCH
|
export ARCH
|
||||||
|
@ -796,10 +798,10 @@ OUTPUT_FORMAT ?= elf32-i386
|
||||||
OUTPUT_ARCH ?= i386
|
OUTPUT_ARCH ?= i386
|
||||||
|
|
||||||
quiet_cmd_ar_target = AR $@
|
quiet_cmd_ar_target = AR $@
|
||||||
# Assume that if the directory listed in libs-y contains built-in.o,
|
# Do not put lib.a into libzephyr.a. lib.a files are to be linked separately to
|
||||||
# it has been linked into the upper level built-in.o
|
# the final image
|
||||||
cmd_ar_target = rm -f $@; $(AR) rcT$(KBUILD_ARFLAGS) $@ \
|
cmd_ar_target = rm -f $@; $(AR) rcT$(KBUILD_ARFLAGS) $@ \
|
||||||
$(filter-out $(libs-y), $(KBUILD_ZEPHYR_MAIN))
|
$(filter-out %/lib.a, $(KBUILD_ZEPHYR_MAIN))
|
||||||
libzephyr.a: $(zephyr-deps)
|
libzephyr.a: $(zephyr-deps)
|
||||||
$(call cmd,ar_target)
|
$(call cmd,ar_target)
|
||||||
|
|
||||||
|
@ -817,7 +819,7 @@ quiet_cmd_create-lnk = LINK $@
|
||||||
echo "$(app-y)"; \
|
echo "$(app-y)"; \
|
||||||
echo "libzephyr.a"; \
|
echo "libzephyr.a"; \
|
||||||
echo "$(LINKFLAGPREFIX)--no-whole-archive"; \
|
echo "$(LINKFLAGPREFIX)--no-whole-archive"; \
|
||||||
echo "$(filter %/lib.a, $(libs-y))"; \
|
echo "$(filter %/lib.a, $(KBUILD_ZEPHYR_MAIN))"; \
|
||||||
echo "$(objtree)/arch/$(ARCH)/core/offsets/offsets.o"; \
|
echo "$(objtree)/arch/$(ARCH)/core/offsets/offsets.o"; \
|
||||||
echo "$(LINKFLAGPREFIX)--end-group"; \
|
echo "$(LINKFLAGPREFIX)--end-group"; \
|
||||||
echo "$(LIB_INCLUDE_DIR) $(LINK_LIBS)"; \
|
echo "$(LIB_INCLUDE_DIR) $(LINK_LIBS)"; \
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
ifeq ($(CONFIG_KERNEL_V2),y)
|
ifneq ($(CONFIG_KERNEL_V2),y)
|
||||||
obj-y = unified/
|
|
||||||
else
|
|
||||||
obj-y = nanokernel/
|
obj-y = nanokernel/
|
||||||
obj-$(CONFIG_MICROKERNEL) += microkernel/
|
obj-$(CONFIG_MICROKERNEL) += microkernel/
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue