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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99183C4332F for ; Tue, 14 Nov 2023 18:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A1ta+t+PcfC9oWHyav+YknYWuSvPmRcf0oyfnA7fMvY=; b=Qz+NcRheuQWs7M KzkO17Qf1An0KHAskAnDjis0sxx7pijdOnXiOBT/+XgBsuoB51DsNxoVj6k4htiXHgtKNrcKCKRZi 54VaybwHLAejE9/XXs25pbhlCN/hbgO9GE908y+uw4/xYa0wnnYtnq5KCLyow9SAntD1aBXcfJmhW qk43sFcLt0MBukslaksoMgJ6borTW8M+4RcdJz6QXNohUoIopm05cWPSfIovQkrOmsvLfCTe55ypL 1YiHNtmUVbneE4TeEjTYd+7ZEjlqzv24uudG7mlLn+sS6efVLjZO4XlfaOGvz2hTmU+zegX9MwWUe QnRFi1wBX0O1UcXVE4rA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2xr7-00GYjH-2M; Tue, 14 Nov 2023 18:09:45 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2xr4-00GYiC-0h for linux-arm-kernel@lists.infradead.org; Tue, 14 Nov 2023 18:09:43 +0000 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-3594c100735so104945ab.1 for ; Tue, 14 Nov 2023 10:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699985379; x=1700590179; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=xxYwdpdF8JJ3J8eR5fcrs9vFQuvJKtKmfDNv9P4y+IA=; b=IkJ+fKQVFEv81xHCQWLNuXPov72LkuNOXAthHivNu8lgusb7aT1Oqv6KZq5mmNVviD mKloDATEPltAbe/ELYZu6tKaJ4xkm4K++5JgEsFgWKAvQbMfCXsAM/d/e6nDl3MpOgBN FSmeZyA934rXwVtuznbDh7g+2zLazlBXOkoicUf/RlzW5JU7b7TSf1c5QPDdttNk3z1N jOG2rxCmo/Tx7FagKLL5cmFGST97Fasp24ds0vULPIpJ8bHUWLzMCzEKcco4N+DinCPk VG1i1A8cbjsYNfRfZyHhYNiWtpvbgrQ0x046K1z0DoBbymtPbEcVQn2Df2Th8cQKpbzm feSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699985379; x=1700590179; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xxYwdpdF8JJ3J8eR5fcrs9vFQuvJKtKmfDNv9P4y+IA=; b=HKZT3lh51Pkn2DhEzcgz8XE+XWin4xlJdDvaFVZ0urvDUrfScoFfF6pACQpN7grHLg 2PSzP7IVJnMSTx03rRTe3fjoyre1u8onos0PPl43OiQmYP+zeYF2YcL41l6ERhyU7FO9 C8pMVss6sDQ1olyv5fURkN4KJqTUD6wWzpiNkewyfxrbkYp+oDmsIQeZxNjqLVJMZboF jGWLOLdyw0x8SKFgUdv4SZKm4tOHOcIAQJBIaGWE63nzuKN2E/InS9fN//U2XzeOLn7K LTXtC+nOf0tILQ+rf2fggiYfOzWDOsKgSrb6l4tg9sDuCpFacx7iSp+NWKDo8QV47Rzq mCUw== X-Gm-Message-State: AOJu0YykLCEHucKwsBIXJmd3p+bXR6WFjhXGae5WBEgkUYFJpw1z8U2P 3as7bEU1zyTh62i+8hK2e2w= X-Google-Smtp-Source: AGHT+IFRlkfEouch/0EEOLd8mbYLL0IWatZQFkhv2orilRN+MVYu2ZPc6Aiq2uW+RdzhcoQXU8703A== X-Received: by 2002:a05:6e02:1b05:b0:359:315c:368b with SMTP id i5-20020a056e021b0500b00359315c368bmr3551685ilv.4.1699985379589; Tue, 14 Nov 2023 10:09:39 -0800 (PST) Received: from ?IPV6:2001:470:42c4:101:767d:e2ee:ed0:5f02? ([2001:470:42c4:101:767d:e2ee:ed0:5f02]) by smtp.gmail.com with ESMTPSA id i15-20020a056e021b0f00b0035acf801fe5sm347413ilv.64.2023.11.14.10.09.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Nov 2023 10:09:39 -0800 (PST) Message-ID: Date: Tue, 14 Nov 2023 11:09:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] ACPI: acenv: Permit compilation from within the kernel Content-Language: en-US To: Linus Walleij , "Rafael J. Wysocki" , Len Brown , Robert Moore , Dave Jiang , Jonathan Cameron , Dan Williams , Hanjun Guo , Arnd Bergmann Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org> From: Sam Edwards In-Reply-To: <20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_100942_297437_698C6263 X-CRM114-Status: GOOD ( 20.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/13/23 16:08, Linus Walleij wrote: > After commit a103f46633fd the kernel stopped compiling for > several ARM32 platforms that I am building with a bare metal > compiler. Bare metal compilers (arm-none-eabi-) don't > define __linux__. Hi Linus, I saw the same baremetal-compiler error here on the ARM64 side of the fence, and narrowed the problem to the same commit as you. > > This is because the header is now > in the include path for : More generally, I think it's because of this addition to linux/acpi.h: +#include linux/acpi.h is supposed to ensure _LINUX is defined (if it isn't already done by a non-baremetal compiler) before we start pulling in ACPICA includes, so that ACPICA knows the platform. But because fw_table.h contains: #include #include ...the circular include does nothing (linux/acpi.h's include guard stops the include before _LINUX is defined) and we end up pulling in acpi/acpi.h before we're ready. > > CC arch/arm/kernel/irq.o > CC kernel/sysctl.o > CC crypto/api.o > In file included from ../include/acpi/acpi.h:22, > from ../include/linux/fw_table.h:29, > from ../include/linux/acpi.h:18, > from ../include/linux/irqchip.h:14, > from ../arch/arm/kernel/irq.c:25: > ../include/acpi/platform/acenv.h:218:2: error: #error Unknown target environment > 218 | #error Unknown target environment > | ^~~~~ > > One solution to make compilation with a bare metal compiler > work again is to say the file is used with Linux from within > the kernel if __KERNEL__ is defined so I did that. I am not an ACPI subsystem maintainer, but my understanding is that the files in include/acpi/ are copied verbatim from ACPICA, so any change to those files will have to be sent to the ACPICA project and wouldn't be accepted here. More likely, we'd want to do something about the circular-include situation between linux/fw_table.h<->linux/acpi.h. That may have further consequences down the road than just our problem here. Perhaps just dropping both #includes from fw_table.h, and lowering the fw_table.h include from within linux/acpi.h to be below , is the way to go? Kind regards, Sam _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel