From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932215AbdEJQml (ORCPT ); Wed, 10 May 2017 12:42:41 -0400 Received: from merlin.infradead.org ([205.233.59.134]:55518 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754613AbdEJQma (ORCPT ); Wed, 10 May 2017 12:42:30 -0400 Subject: Re: sparse on scripts/kconfig/*.c To: Christoph Hellwig Cc: linux-kbuild , Dan Carpenter , LKML References: <20170509201714.GA24001@infradead.org> <20170510072833.GA4619@infradead.org> From: Randy Dunlap Message-ID: <21a25b58-2813-fd1d-0caa-266b8c7928cd@infradead.org> Date: Wed, 10 May 2017 09:42:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170510072833.GA4619@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/10/17 00:28, Christoph Hellwig wrote: > On Tue, May 09, 2017 at 05:27:01PM -0700, Randy Dunlap wrote: >> On 05/09/17 13:17, Christoph Hellwig wrote: >>> On Tue, May 09, 2017 at 09:47:41AM -0700, Randy Dunlap wrote: >>>> Hi, >>>> >>>> I've been attempting to run sparse on the kconfig/ C files -- without success. >>>> >>>> The kbuild files don't try to support CHECK in scripts/kconfig/ AFAICT, >>>> and just running sparse on the C files has issues with not being able to >>>> find header files. >>>> >>>> Has anyone done this? Any clues about how to do it? >>> >>> As a wild guess from using sparse on various userspace projects: >>> >>> have you tried simply setting HOSTCC to cgcc? >> >> I don't quite see what that has to do with running sparse ($CHECK, not $HOSTCC). > > cgcc is a gcc wrappr that calls sparse. I just trie quickly to patch > Makefile to run cgcc instead of gcc as HOSTCC an it seems to work: > > HOSTCC scripts/basic/fixdep Agreed, that does it. > scripts/basic/fixdep.c:117:5: warning: symbol 'insert_extra_deps' was not declared. Should it be static? > scripts/basic/fixdep.c:118:6: warning: symbol 'target' was not declared. Should it be static? > scripts/basic/fixdep.c:119:6: warning: symbol 'depfile' was not declared. Should it be static? > scripts/basic/fixdep.c:120:6: warning: symbol 'cmdline' was not declared. Should it be static? > > But then I run into the known cgcc bug that it also calls sparse when > called for linking. Which reminds me that I need to go back and fix > that. > Thanks to both you and Dan for your help. -- ~Randy