From patchwork Wed Jul 16 07:12:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 4564851 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5C77C0514 for ; Wed, 16 Jul 2014 07:12:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDAFC201C0 for ; Wed, 16 Jul 2014 07:12:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CA2A201B9 for ; Wed, 16 Jul 2014 07:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759216AbaGPHMi (ORCPT ); Wed, 16 Jul 2014 03:12:38 -0400 Received: from smtp.mei.co.jp ([133.183.100.20]:47570 "EHLO smtp.mei.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759143AbaGPHMi (ORCPT ); Wed, 16 Jul 2014 03:12:38 -0400 Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile11) with ESMTP id s6G7CRG0026666; Wed, 16 Jul 2014 16:12:27 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili15) with ESMTP id s6G7CSB12444; Wed, 16 Jul 2014 16:12:28 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi11) id s6G7CSuZ015533; Wed, 16 Jul 2014 16:12:28 +0900 Received: from poodle by lomi11.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s6G7CR1X015468; Wed, 16 Jul 2014 16:12:27 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 9C6FF2740043; Wed, 16 Jul 2014 16:12:27 +0900 (JST) From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Masahiro Yamada Subject: [PATCH v3 2/5] kbuild: fix a bug of C++ host program handling Date: Wed, 16 Jul 2014 16:12:20 +0900 Message-Id: <1405494743-29566-3-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405494743-29566-1-git-send-email-yamada.m@jp.panasonic.com> References: <1405494743-29566-1-git-send-email-yamada.m@jp.panasonic.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes in v3: None Changes in v2: None scripts/Makefile.host | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 395a240..bf44e79 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -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),\