Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4204802imm; Mon, 20 Aug 2018 11:36:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzpGaZtkbrrlG7ByS5ZLSOvgfPauCYDQ9B/sfgCU4zb8Eu31Czp+cB23GGNOHR8NmSjHv9o X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr49710625pfe.209.1534790165240; Mon, 20 Aug 2018 11:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534790165; cv=none; d=google.com; s=arc-20160816; b=xbIxX0LrO5ylAxiR1boeT8g01dYdJ75VUvtwhSeBD6E2mv2S8u8v70zoU8lGwxFbjy K395/Vx15hk3LpQzvUFobA8k7jYvgwRLkcXQyKmNFWiO6cH65f6YjYauYr5VacR0Guoz 16xdB/TAmSmB62dRl3nLY9JOQY6E3ZN8jmRptTk+4HuujXllkzH+MyQLmOOacoaP5s/S 8rD5KzXx9sv8fO4UAwkeRJF+NU+pUdUFUDTUvOcLqhkPfBJtnFtpFJZSNT0xCHOkrQbL Uh5v1swlZq/TnfGspmGSBNxK+lZIrgGMlPAj0o3veLKjvyuRyMi7umt0yc2v6VJzs0qq Fu+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=2W8rchIZuBBwWufoescXf9LVkpw2kurORbSR6aWKOJY=; b=hFJTOiXsaQKlJjIER3u+X/LIvEgMOrO7n2D5hVUY9cZOvEFQjCAHQJ6MLZadphp542 3ZWa5mV+LBpd+iP6Hj2jaPTOFzHJ/isJzFQ5/lhYbIY2lO+t/GdkI4b94kkZWVkLrmdL F6e/72OSNFg+q9rJShRHQy09vp9AOf8bUmS7eG/xlVanNwzj2GQiBYL4k6GOS3p3+buo QRY0w6DFsMypLaEd9AeDm/EJD0S3VaYxcn5NSrwEoyk7TLPHffMhXbHQ6WbLalnb+A0l gdATuo0Tey0pbfZlMFi3LOXcej38ZZ09zV0G4qrh1E/zNKsfXYYa1ksfF2r0QSsmmDWf NXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b="WNl+6ou/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd6-v6si10590554plb.379.2018.08.20.11.35.49; Mon, 20 Aug 2018 11:36:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@wavesemi.onmicrosoft.com header.s=selector1-wavecomp-com header.b="WNl+6ou/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbeHTVvZ (ORCPT + 99 others); Mon, 20 Aug 2018 17:51:25 -0400 Received: from mail-eopbgr730113.outbound.protection.outlook.com ([40.107.73.113]:28539 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726089AbeHTVvY (ORCPT ); Mon, 20 Aug 2018 17:51:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2W8rchIZuBBwWufoescXf9LVkpw2kurORbSR6aWKOJY=; b=WNl+6ou/3UFbXkti3RTNOO4bOvT7DkH3kAG6EGsbJvTDYXj/ToUBuC0/gvrCC94/rAXl5Kg362nAI8mRPSUC5a5yDwd3lhvolVswK2jNr7piFUzKCzcEYze97kVa+O/6Nudv9WajXxB9EzhmhUVBioqm0/wV664htDA+YrbimQE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; Received: from localhost (4.16.204.77) by BYAPR08MB4936.namprd08.prod.outlook.com (2603:10b6:a03:6a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Mon, 20 Aug 2018 18:34:20 +0000 Date: Mon, 20 Aug 2018 11:34:17 -0700 From: Paul Burton To: Masahiro Yamada Cc: Linux-MIPS , linux-arch , Arnd Bergmann , James Hogan , Linux Kbuild mailing list , Linux Kernel Mailing List , Ralf Baechle Subject: Re: [PATCH v8 1/2] kbuild: Allow asm-specific compiler_types.h Message-ID: <20180820183417.dejfsluih7elbclu@pburton-laptop> References: <20180818181017.1246-1-paul.burton@mips.com> <20180818181017.1246-2-paul.burton@mips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Originating-IP: [4.16.204.77] X-ClientProxiedBy: BN6PR1001CA0029.namprd10.prod.outlook.com (2603:10b6:405:28::42) To BYAPR08MB4936.namprd08.prod.outlook.com (2603:10b6:a03:6a::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d4341a1-46d0-4e8e-ff7b-08d606cb8bbc X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BYAPR08MB4936; X-Microsoft-Exchange-Diagnostics: 1;BYAPR08MB4936;3:qfmyxYBdyOPmRo1IFu85z+hNmECcQQpfg77VNZ58RClYl7mfeIH+PGS7IV6fhvcRWL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guEfzKZTlKOp4eWX+AP;4:J2d/+9x3/Ixz0e3bWg7WJLX1a72d0+RNIGRkQcfa8rf+8rGH5Ugb/xxSjWktpiCkHyi8g7F6Q1Vig3VC9o++Q1bjKHIcWbATeO/W+SGpcEEXmWYlA+ke+sl5o5lCDTNGeiNu/XGwfvBb5f6o9QTXb3fmqufERa6xkeoxjNAQatWc19Yd5Llw9AfkUkdimltaHqP1nc59tW2Ty+bUqOxFif7M3I4iFkbbYaj3HThrTkNUO+iTspYB8tmvsG5HAUmL7vU+DW1xnl35ujZ3V4yAzg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123560045)(20161123562045)(201703131423095)(20161123555045)(201703061421075)(20161123564045)(20161123558120)(201708071742011)(7699016);SRVR:BYAPR08MB4936;BCL:0;PCL:0;RULEID:;SRVR:BYAPR08MB4936; X-Forefront-PRVS: 0770F75EA9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(7916004)(366004)(136003)(376002)(346002)(199004)(189003)(33896004)(33716001)(6496006)(52116002)(66066001)(229853002)(6486002)(25786009)(76176011)(50466002)(305945005)(4326008)(9686003)(6246003)(76506005)(7736002)(3846002)(53936002)(105586002)(6666003)(106356001)(47776003)(1076002)(23726003)(6116002)(54906003)(956004)(476003)(6916009)(486006)(58126008)(42882007)(97736004)(16586007)(446003)(68736007)(11346002)(2906002)(44832011)(81166006)(81156014)(26005)(508600001)(16526019)(186003)(14444005)(386003)(8676002)(8936002)(5660300001);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR08MB4936;H:localhost;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) X-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Axx0KgNaaAE3DXVWJ8LSKvY4zEbVzNCbWscyH9MKynHypjpDFH1ond6ffym+wPS/2XNo5dehhW5jlNPLe+Oy0U5ii9j23EqtlMsZEa5dGKLNoiHtBKHpUDJIFXSSduQRaYLfPpxfzssS8F58zkapVDN1lohW1TRkG/X9ZFvgXLg0ohacCRqTkT6vge37tcVd9n57RoS9/lpNcgbqMaRXOEzXBSx9E+ZTIFr6S0cSUK2f0yx26D+K80IH2Z8ZnR1h/eWY5Vbf5GIIYdH7p89zrzk+uuh1awExEnpBe4rOxqx9YHlC7dE0t56uH1Zy3aVV5vT+etS9+7CFMi37JDqP0KNA/oNgHK8rLyBRguf/98JeQ==;5:6OhKaOXFW39Vw4uC4SGeS7MQ0KLAVKRmMkCzaCsv6/FfTamzw66ygtjrcMrlr+bHTRl6V8ZpuG8Id8XQ8JnbOptaQ9KpnvgSGv+NUa/LzanpdLB8MH9EYlf/gvVu1fm0LwdkTcd2TfyQjuMCno8L6CuVdeODwuBsj11+sZYbkh8=;7:eldkB2uFtae/QFfyZL8ih+3JcXdo134na80h03m8QK8f0pkeebeH0vcyHnpC+UJuRUQ9Y8/f2HwknNXl68YX56nQX32wlmLvnujisMpOYiEt0uo86h2s/vddor1Zmzut8p4SuCBfl89m5Tmc/bVskm/IcIK6XR17NWtGldVu6I29Ki/ASivK/En+1MZpylM9b45MSmupqn4l2JkT7kCaWJXFsC/SJqkSEXZbYLsgAWHQKtn61heYNOy7OAhJnJ2m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2018 18:34:20.8925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d4341a1-46d0-4e8e-ff7b-08d606cb8bbc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR08MB4936 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, On Mon, Aug 20, 2018 at 02:04:24PM +0900, Masahiro Yamada wrote: > 2018-08-19 3:10 GMT+09:00 Paul Burton : > > We have a need to override the definition of > > barrier_before_unreachable() for MIPS, which means we either need to add > > architecture-specific code into linux/compiler-gcc.h or we need to allow > > the architecture to provide a header that can define the macro before > > the generic definition. The latter seems like the better approach. > > > > A straightforward approach to the per-arch header is to make use of > > asm-generic to provide a default empty header & adjust architectures > > which don't need anything specific to make use of that by adding the > > header to generic-y. Unfortunately this doesn't work so well due to > > commit a95b37e20db9 ("kbuild: get out of > > ") which moved the inclusion of linux/compiler.h to > > cflags using the -include compiler flag. > > > > Because the -include flag is present for all C files we compile, we need > > the architecture-provided header to be present before any C files are > > compiled. If any C files can be compiled prior to the asm-generic header > > wrappers being generated then we hit a build failure due to missing > > header. Such cases do exist - one pointed out by the kbuild test robot > > is the compilation of arch/ia64/kernel/nr-irqs.c, which occurs as part > > of the archprepare target [1]. > > > > This leaves us with a few options: > > > > 1) Use generic-y & fix any build failures we find by enforcing > > ordering such that the asm-generic target occurs before any C > > compilation, such that linux/compiler_types.h can always include > > the generated asm-generic wrapper which in turn includes the empty > > asm-generic header. This would rely on us finding all the > > problematic cases - I don't know for sure that the ia64 issue is > > the only one. > > > > 2) Add an actual empty header to each architecture, so that we don't > > need the generated asm-generic wrapper. This seems messy. > > > > 3) Give up & add #ifdef CONFIG_MIPS or similar to > > linux/compiler_types.h. This seems messy too. > > > > 4) Include the arch header only when it's actually needed, removing > > the need for the asm-generic wrapper for all other architectures. > > > > This patch allows us to use approach 4, by including an > > asm/compiler_types.h header using the -include flag in the same way we > > do for linux/compiler_types.h, but only if the header actually exists. > > I agree with the approach 4), > but I am of two minds about how to implement it. > > I guess the cost of evaluating 'wildcard' for each C file > is unnoticeable level, but I am slightly in favor of > including from > conditionally. > > I am not sure about the CONFIG name, but for example, like this. > > #ifdef CONFIG_HAVE_ARCH_COMPILER_TYPES > #include > #endif > > What do you think? That sounds fine to me - I'll submit a v9 shortly :) Thanks, Paul