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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 1D760C433EF for ; Tue, 14 Sep 2021 01:29:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EECB861130 for ; Tue, 14 Sep 2021 01:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235759AbhINBbD (ORCPT ); Mon, 13 Sep 2021 21:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbhINBbD (ORCPT ); Mon, 13 Sep 2021 21:31:03 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BC73C061760 for ; Mon, 13 Sep 2021 18:29:46 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id j12so20611999ljg.10 for ; Mon, 13 Sep 2021 18:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Bwi8JzS7IUd8bGkWIzVwnKvogSVEcsXYPsg+JItZ8oM=; b=fiY6IKkngrztRhJGLgdJI9edL8TxraujPTd/SV9hEAguGAT699jCnoG9v8OqqH6g18 Q/qWrqcQakgXqGliTOaGo0x4Pbjavw5l8FSGzMGvdRux3P6zyr3TBrlLAYFaZ0KiKcI8 Ui5X/EZ1nitBe2QYSn5SdXndTGE/D8aiGMAJc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Bwi8JzS7IUd8bGkWIzVwnKvogSVEcsXYPsg+JItZ8oM=; b=MD31xUzvFILB18QynsWHcBFs22LWDKiAUeMlkiqxgcEmqKeWqvtm/H8ibH3mSzqnn9 c6Ih5pGwhjPSBEQPz167J89nJexBtfwpzgzt6k3TNQD8PkC8Ff3F8xuP79l0kgnlTEpd Rx2VeagnALeceseEjkXBUm41ZxRRJXGvdLfmeQt1ebzOQ0fc/M4LAjoTkO3zmkthF7NU 7UGx8u04oO12OhZPcaXXeFQCp5NOGjR8NNbJMnrcxCfLY7JA8xFZ3VxuYhqWK4VkQI2w EWnHhAQCXHUWcWvEyT8LnErVMWtH7NwDNG5igLxjrFj3sg8AlxE3g0R5OYDvcNpEw3E9 jWLQ== X-Gm-Message-State: AOAM533h81/HbcajJ2lgY3xJflVWRXE1tsc5dfK6yd9J+Np4D9Wdmbre BMBJksT0jdSTE6tWogA7aoIgmDmZ6653NngFJlM= X-Google-Smtp-Source: ABdhPJwhHOrpat/FdRzUXeOP80pn88kFBjTc4v5HtucXdSEyGFlFw/ZFz0aesVFp14ZIhHuPNJ6hrQ== X-Received: by 2002:a05:651c:1685:: with SMTP id bd5mr12736847ljb.505.1631582984159; Mon, 13 Sep 2021 18:29:44 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id h11sm1047688lfr.230.2021.09.13.18.29.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 18:29:43 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id w4so20601384ljh.13 for ; Mon, 13 Sep 2021 18:29:42 -0700 (PDT) X-Received: by 2002:a05:651c:158e:: with SMTP id h14mr9527198ljq.56.1631582982632; Mon, 13 Sep 2021 18:29:42 -0700 (PDT) MIME-Version: 1.0 References: <20210914100853.3f502bc9@canb.auug.org.au> <20210914105359.5c651d55@canb.auug.org.au> In-Reply-To: <20210914105359.5c651d55@canb.auug.org.au> From: Linus Torvalds Date: Mon, 13 Sep 2021 18:29:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: linux-next: build failure after merge of the origin tree To: Stephen Rothwell Cc: Linux Kernel Mailing List , Linux Next Mailing List , Michael Ellerman , PowerPC Content-Type: multipart/mixed; boundary="0000000000001a287705cbea846b" Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org --0000000000001a287705cbea846b Content-Type: text/plain; charset="UTF-8" On Mon, Sep 13, 2021 at 5:58 PM Stephen Rothwell wrote: > > > I have no idea why it then complains about removal of the GCC4 macros. > > Me neither :-( Ooh. So I'm looking at gcc sources, just to see if "maybe this thing is somehow conditional". And bingo. In cpp_init_special_builtins(), gcc does if (b->value == BT_HAS_ATTRIBUTE && (CPP_OPTION (pfile, lang) == CLK_ASM || pfile->cb.has_attribute == NULL)) continue; which basically says that if we're pre-processing an ASM file, the magical pre-processor symbol for __has_attribute is not defined. I'm not sure what that 'pfile->cb.has_attribute == NULL' thing means, but the libcpp/ChangeLog file also mentions this: (cpp_init_special_builtins): Don't initialize __has_attribute or __has_cpp_attribute if CLK_ASM or pfile->cb.has_attribute is NULL. So this is a very very special magical thing: if building an *.S file, __has_attribute magically goes away. And sure enough, that's exactly what is going on. It's during that build of arch/powerpc/boot/crt0.S, and the reason this hits on powerpc is that in arch/powerpc/boot/Makefile we have -include $(srctree)/include/linux/compiler_attributes.h as part of BOOTCFLAGS, and then it does BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc to also include that header file when building ASM files. And our old GCC4 code silently hid this all, and made it work, because for a *.S file you'd then (completely illogically) get those fake gcc-4 attribute macros. Now, do I know *why* that ppc Makefile it does that? No. Neither do I know why the gcc people decided to just make ASM preprocessor so special. But at least I understand how the odd error happens. This was too damn subtle. When you have to go read the compiler sources to figure things like this out, you know you are too deep. The fix should be pretty simple: remove almost all of BOOTCFLAGS from BOOTAFLAGS. But sadly, "almost all" isn't "all". There's the include path stuff, there's the ABI and endianness, and there's the bit size ones. So I think the fix is either (a) remove that -include $(srctree)/include/linux/compiler_attributes.h thing entirely, and add it as required to the C files. OR (b) something like this ENTIRELY UNTESTED ATTACHED patch I will leave it to the powerpc people to make the right choice. Linus --0000000000001a287705cbea846b Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ktjeb6jv0 IGFyY2gvcG93ZXJwYy9ib290L01ha2VmaWxlIHwgMjYgKysrKysrKysrKysrKystLS0tLS0tLS0t LS0KIDEgZmlsZSBjaGFuZ2VkLCAxNCBpbnNlcnRpb25zKCspLCAxMiBkZWxldGlvbnMoLSkKCmRp ZmYgLS1naXQgYS9hcmNoL3Bvd2VycGMvYm9vdC9NYWtlZmlsZSBiL2FyY2gvcG93ZXJwYy9ib290 L01ha2VmaWxlCmluZGV4IDY5MDBkMGFjMjQyMS4uOWJjZjYyZDY1NTA5IDEwMDY0NAotLS0gYS9h cmNoL3Bvd2VycGMvYm9vdC9NYWtlZmlsZQorKysgYi9hcmNoL3Bvd2VycGMvYm9vdC9NYWtlZmls ZQpAQCAtMzIsMjggKzMyLDMwIEBAIGVsc2UKICAgICBCT09UQVIgOj0gJChBUikKIGVuZGlmCiAK LUJPT1RDRkxBR1MgICAgOj0gLVdhbGwgLVd1bmRlZiAtV3N0cmljdC1wcm90b3R5cGVzIC1Xbm8t dHJpZ3JhcGhzIFwKLQkJIC1mbm8tc3RyaWN0LWFsaWFzaW5nIC1PMiAtbXNvZnQt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