From patchwork Tue Feb 18 11:11:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1239952 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.a=rsa-sha256 header.s=dec2015msa header.b=okrtpKm3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48MJ8r0P3Fz9sRf for ; Tue, 18 Feb 2020 22:12:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C3BF081248; Tue, 18 Feb 2020 12:12:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="okrtpKm3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C34F38128F; Tue, 18 Feb 2020 12:12:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C28D80379 for ; Tue, 18 Feb 2020 12:12:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=masahiroy@kernel.org Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id 01IBBSUH015498; Tue, 18 Feb 2020 20:11:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 01IBBSUH015498 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582024288; bh=Y1sPgMgeA/2DrIzeS7RaTs/xlt2BATpvx8ZzKOju2E4=; h=From:To:Cc:Subject:Date:From; b=okrtpKm3Kp6JCC/ARzJ4M44sVcxh9bXsbK+unEUpn7g96QNW/Mkt4Rnd/JvCCUt0M PxjBqUNfY+6iCzqoy4dZhmgDapZPfqSP8UAS3v+EBY+mu5tBdEtEjcBBtodteeg0Vj oU5J6Ka9AA6s2ksO0Z0sJ822PlmtiAKji0YxjlPFl2ebB/9NGslDYFeKgtJPz7uQM6 e8DiD/y+HCWiAc08+w7/niZxhwQROfe7XPYuqRVRFBjpzxKzpKwsulvjBZA02lfpuG 7NfOWDaa62/hc8rK0UkAeGFvCXZZLbnJYWYtSlUsQh5d1Y6qU57uARt7hpjLH0VUhq ANo6vek4PE8XA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Tom Rini , Masahiro Yamada Subject: [PATCH B] fixdep: fix U-Boot own code to handle only valid symbol characters Date: Tue, 18 Feb 2020 20:11:23 +0900 Message-Id: <20200218111123.25423-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean Currently, fixdep skips parsing include/linux/kconfig.h, but if it parsed it, it would translate the following code in kconfig.h config_enabled(CONFIG_VAL(option##_MODULE) into: $(wildcard include/config/option##/module.h) When Kbuild includes .*.cmd, it would emit the following error: *** unterminated call to function 'wildcard': missing ')'. Stop. This issue prevents us from importing the upstream Linux commit 638e69cf2230 ("fixdep: do not ignore kconfig.h"). Fix this by handling only alphanumerical characters and underscores. This makes sense because they match to the valid character sets in Kconfig symbols. As a side-note, you can reproduce this issue only on GNU Make <= 4.2.1 For GNU Make <= 4.2.1, the '#' always means the start of a comment. Hence, GNU Make thinks the closing ')' is missing. The following commit in GNU Make changed how it handles '#' in function invocations. So, this does not happen for GNU Make 4.3 | commit c6966b323811c37acedff05b576b907b06aea5f4 | Author: Paul Smith | Date: Thu Dec 22 18:47:26 2016 -0500 | | [SV 20513] Un-escaped # are not comments in function invocations Fixes: 8be60f06c258 ("linux/kconfig.h: add CPP macros useful for per-image config options") Signed-off-by: Masahiro Yamada --- This patch is applicable on top of Tom's resync: scripts/basic/fixdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 8c21dd08d9f7..0ff564a5cc86 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -255,7 +255,7 @@ static void parse_config_file(const char *p) (q - p == 9 && !memcmp(p, "IS_MODULE(", 10)) || (q - p == 3 && !memcmp(p, "VAL(", 4))) { p = q + 1; - while (*q && *q != ')') + while (isalnum(*q) || *q == '_') q++; r = q; if (r > p && is_spl_build) {