From patchwork Tue Feb 18 11:05:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1239950 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=tVpIAVPc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 48MJ2b1yHhz9sRf for ; Tue, 18 Feb 2020 22:06:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2295E8128F; Tue, 18 Feb 2020 12:06:34 +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="tVpIAVPc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45E67812E7; Tue, 18 Feb 2020 12:06:32 +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-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) (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 462AD81248 for ; Tue, 18 Feb 2020 12:06:26 +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-10.nifty.com with ESMTP id 01IB5g1N028505; Tue, 18 Feb 2020 20:05:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com 01IB5g1N028505 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1582023942; bh=PqRIaAYCuleGRt7PiFjQsIBnIghNov/QsOhPGWYP4+Q=; h=From:To:Cc:Subject:Date:From; b=tVpIAVPcwVWw5oe0nlj5Dxmucnz1e44cIqxSCgFKlbwLpcm7s3/C6YOhQuv2liB4c Hip/5Aa1u4YjQrQGsxWDqk1fdgR8IxS+GNSPb0rwdHOw8e5juhOAIMhEtHS0xWvuRN ClXdFK6rBtb/bH0L75HnsdJYx/u5S5MeQc+PKmHbmls8/KpLaIlsjvQ1PBxC9tlhLK 7o89HP9m0cmivEuwf0mWaGueyvX47ZS6mqWTGaoAnlQDvZid0/OscA0U6MGzgJkJXF Kepp6wSG3z95Qx61OkGbBIAx7L/KIYFTHyaxziotl5mg/Hlw5DGlEvBz9wnj2p5T8c Hj4YaNR2qCoag== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Tom Rini , Masahiro Yamada Subject: [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters Date: Tue, 18 Feb 2020 20:05:39 +0900 Message-Id: <20200218110539.24735-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 Signed-off-by: Masahiro Yamada Reported-by: Tom Rini --- This patch is applicable to the current upstream code. 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 da7fb2cd4dde..6a668f114096 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -262,7 +262,7 @@ static void parse_config_file(const char *map, size_t len) (q - p == 3 && !memcmp(p, "VAL(", 4))) { p = q + 1; for (q = p; q < map + len; q++) - if (*q == ')') + if (!(isalnum(*q) || *q == '_')) goto found2; continue;