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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8DDE8C43603 for ; Tue, 10 Dec 2019 03:18:28 +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 3EC9720726 for ; Tue, 10 Dec 2019 03:18:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EC9720726 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu 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 1ieW26-0000Qi-Hi; Mon, 09 Dec 2019 22:17:54 -0500 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1ieW1x-0000QV-73 for kernelnewbies@kernelnewbies.org; Mon, 09 Dec 2019 22:17:45 -0500 Received: from mr4.cc.vt.edu (mr4.cc.vt.edu [IPv6:2607:b400:92:8300:0:7b:e2b1:6a29]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id xBA3Hgh3003232 for ; Mon, 9 Dec 2019 22:17:43 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mr4.cc.vt.edu (8.14.7/8.14.7) with ESMTP id xBA3HbuA009148 for ; Mon, 9 Dec 2019 22:17:42 -0500 Received: by mail-qt1-f198.google.com with SMTP id b24so1008220qtp.1 for ; Mon, 09 Dec 2019 19:17:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=9QSMADjn/P/wbXjuYEvjJ+HRelFDg3vKb2H4hSfajvo=; b=dqshGYxYUe9WilBQ+5KWD22I2nwkcL83ZdyzDruLP29A8Tt0I2jYrf93nWbOAqNn9E 1DQKkBJRB9Mn/W3O9OPdbd8kkiVJ+x3mhZnVqmkBBQZAtJaVyd940bTupdO/v7t21/of s/zC5fLO5zWXxlifgoa3obMp/+YDOW6Bj1skhubo9OExrOeGiIRI44gywx5Jc2rAh9hn j1Pk98L+KDPpQlVqp4ausvEmXdGlOXrrJ+m+nZPkYP8TvhxX79jDeXVileIMWmF3wB4p FGczXTHVywRB2MQZb8kcquLdnIuehXRZKA9TlaJbO12tD6vX0tUUZR3ZfcDbLb+LaZEI 9ILg== X-Gm-Message-State: APjAAAUhGAKP40xya148kisP9fHRhqbkApzg8SlhoncjRUnrWoM3F0RJ Gxr/svptpCW1GE4k5/vmgJ0WNLQ32gYjn9xFXGWudEtKGF1ZD5o0NCH63afPexDk2Qh9DLaZzNc hC51GUajG6KIWtEghdTynTEFHt7ismW/T+94pEk8= X-Received: by 2002:ac8:4244:: with SMTP id r4mr27916394qtm.169.1575947857633; Mon, 09 Dec 2019 19:17:37 -0800 (PST) X-Google-Smtp-Source: APXvYqw97sOsLwX/HhNY/i53zDWazpiEKsOjDOG0D9CyInxrlzYHyFUgIAeKXYQnkizqGIbCy682rA== X-Received: by 2002:ac8:4244:: with SMTP id r4mr27916384qtm.169.1575947857323; Mon, 09 Dec 2019 19:17:37 -0800 (PST) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id t39sm656502qtj.52.2019.12.09.19.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 19:17:35 -0800 (PST) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Konstantin Andreev Subject: Re: How to get the preprocessor output as part of the compilation process? In-Reply-To: <5DEE1D83.2040704@swemel.ru> References: <20191208190302.ngj5qlampi4utjgk@frank-laptop> <5DEE1D83.2040704@swemel.ru> Mime-Version: 1.0 Date: Mon, 09 Dec 2019 22:17:35 -0500 Message-ID: <24456.1575947855@turing-police> Cc: "Frank A. Cancio Bello" , kernelnewbies@kernelnewbies.org 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-Type: multipart/mixed; boundary="===============3122285778324666479==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============3122285778324666479== Content-Type: multipart/signed; boundary="==_Exmh_1575947854_8204P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1575947854_8204P Content-Type: text/plain; charset=us-ascii On Mon, 09 Dec 2019 13:10:11 +0300, Konstantin Andreev said: > 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, And in fact, what you may want to do is have your script invoke gcc *twice*, once with -E, and then a second time with -c, because otherwise the build will die the first time it tries to link together two or more non-existent .o files. Using 'make -k' *might* also work, but will leave the build log output littered with a *lot* of error messages. Or explain why you're doing this - there may be a simpler way to achieve your goal. For instance, if you're trying to build a cross-reference of what .c files include what .h directly or indirectly, there's already specialized tools for doing that sort of thing, such as 'cxref'. --==_Exmh_1575947854_8204P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXe8OTgdmEQWDXROgAQI4qxAAtEjB8XN6ezpjQMNcgTiLZ4wGhTN4PopU q6orhZHS5wE/RGOJgvo189hh+8ixBjlwhD53TgF1VdeMgxrAp175rKmhHkvNj84M bqOX464PMWKHE4DFelljfjGOm/XQp+DwrxG+1lrQfNFdCqErOPm89CdzKjpxdcYq qV+8zcKNfHoDos4DGX62r3c7I8H8NrcYiNtADxIN3kWJHHqo9Hjy2JnAWdt9pb71 syWtgvCC7eMV4XU06BX8yarAA6a7eInQl878VliZzQjETdv+T2tCWW3Gyu8o9huA gsPJ/HiSyh2IIps9b5ljJFw/RBRUVpPeoS+tcRiUQ+DYJfbiCsckZRguJhak9BQA sSeknnBqdUPZcyz+zK5yaAbhtjTt/QH0FqFKyMgHmkzma8O4HQjxGIY2doo1aCQn kUVKeBSLAIt2MfIpdTBr4xoctEsycLc1zBuQvZGaf1Gja27skL0CIAOsxyRfz2bu Xkg2p0pAIJPHUCY8mfY6i2fW0cLl0T2ZCPu4Z/Z4tves3OTpAQPu8lsGM6LG7JBN OxCJdZlOKDL6YE1jijg/VuMipZ4xsWwWjB7qCjLsMb15axWHru23cf/eTud432qq qEiq/4KYh/wsvhaoCvPa9K9MvtTC0W2aKXsbC9MUN6gvG1W6TSOxLgD3XHQL+Fpt tnnLoa14U3o= =f/bk -----END PGP SIGNATURE----- --==_Exmh_1575947854_8204P-- --===============3122285778324666479== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============3122285778324666479==--