Skip to content

Commit

Permalink
kbuild: fix a bug of C++ host program handling
Browse files Browse the repository at this point in the history
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: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
Masahiro Yamada authored and Michal Marek committed Jul 16, 2014
1 parent d8d9efe commit edb950c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/Makefile.host
Original file line number Diff line number Diff line change
Expand Up @@ -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),\
Expand Down

0 comments on commit edb950c

Please sign in to comment.