提交 edb950c1 编写于 作者: M Masahiro Yamada 提交者: Michal Marek

kbuild: fix a bug of C++ host program handling

The comment claims:
  C++ executables compiled from at least one .cc file
  and zero or more .c files

But C++ executables with zero .c file fail in build.

For example, assume we have a Makefile like this:

  hostprogs-y := foo
  foo-cxxobjs := bar.o

In this case, foo is treated as host-csingle
and Kbuild tries to search non-existing foo.c source.
Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 d8d9efe2
......@@ -34,7 +34,8 @@ __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
# C code
# Executables compiled from a single .c file
host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
host-csingle := $(foreach m,$(__hostprogs), \
$(if $($(m)-objs)$($(m)-cxxobjs),,$(m)))
# C executables linked based on several .o files
host-cmulti := $(foreach m,$(__hostprogs),\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册