From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 138A9C43603 for ; Mon, 9 Dec 2019 10:11:06 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C6AA2077B for ; Mon, 9 Dec 2019 10:11:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=swemel.ru header.i=@swemel.ru header.b="J5ErbCw3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C6AA2077B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=swemel.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1ieFzj-0004ca-Qc; Mon, 09 Dec 2019 05:10:23 -0500 Received: from mail.swemel.ru ([79.135.238.163]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1ieFzh-0004cL-90 for kernelnewbies@kernelnewbies.org; Mon, 09 Dec 2019 05:10:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=swemel.ru; s=17022016; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To: References:To:MIME-Version:From:Date:Message-ID; bh=wAu9y5a/3isTeNGbPnZPkGAnooHDpu6SKrH/sJBR2Ec=; b=J5ErbCw3bqENSSnHymxdt/2miQ z1U0Doef3Lj3ldifkthQsHRc+3lHQslpR6k1qs7P0bmPL0cuFRy1O+PiO2NBBjOnN7wkTP1aG8Rhm fofI9dOEtH1yy2O12mNxLKte4WwvZiFzj4w7RJdMouVdF6/E8qK8v66EGoqNj+0UnLkc=; Received: from [10.1.20.204] (helo=mail.swemel.grp) by mail.swemel.ru with esmtp (Exim 4.86_2) (envelope-from ) id 1ieFzY-0003aw-2t; Mon, 09 Dec 2019 13:10:14 +0300 Received: from [10.1.200.208] ([10.1.200.208]) by mail.swemel.grp with Microsoft SMTPSVC(6.0.3790.4675); Mon, 9 Dec 2019 13:10:11 +0300 Message-ID: <5DEE1D83.2040704@swemel.ru> Date: Mon, 09 Dec 2019 13:10:11 +0300 From: Konstantin Andreev Organization: Swemel JSC User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Frank A. Cancio Bello" , kernelnewbies@kernelnewbies.org References: <20191208190302.ngj5qlampi4utjgk@frank-laptop> In-Reply-To: <20191208190302.ngj5qlampi4utjgk@frank-laptop> X-OriginalArrivalTime: 09 Dec 2019 10:10:11.0972 (UTC) FILETIME=[D7F45440:01D5AE78] X-SA-Exim-Connect-IP: 10.1.20.204 X-SA-Exim-Mail-From: andreev@swemel.ru Subject: Re: How to get the preprocessor output as part of the compilation process? X-SA-Exim-Version: 4.2.1 (built Sun, 16 Aug 2015 09:47:37 +0000) X-SA-Exim-Scanned: No (on mail.swemel.ru); Unknown failure X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi, Frank. The universal approach that always works in this and many similar cases is just to replace the instrumented binary by your interception shell script. E.g. rename gcc to gcc.hide (generally, moving into another location may not work) and setup 'gcc' script that does what you want: replaces `-c' with the `-E', replaces `-o' argument, etc ..., calls gcc.hide to preprocess source then calls gcc.hide with original non-modified command line. This is cumbersome process, you can break some things, there may be a handful try and fix iterations, but the advantage is that you have a full control on what is happening, and you do not need support from the tool, build process and product maintainers. The interception like this is used by static code analysis tools. Regards, Konstantin Frank A. Cancio Bello, 08 Dec 2019 MSK: > > Hi, I know that with gcc -E you can get the output of the preprocessor, but what I have to do to get that output for every source code file in the Linux Lernel as part of the compilation process? _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies