From patchwork Mon Nov 13 23:08:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13454560 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 DB69FC4332F for ; Mon, 13 Nov 2023 23:09:24 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WN19wFl/IR2LD2UFgu2cKyDUWNxm6TatWGDocfNq8cc=; b=W6FjSc8tHzszVu 5NNJr2WQY+7+9O5RpsE1ZC9fhqOx7N3oDjDusBteqX6wVa338AxR9P2bB7PmjwEQwKxyFCgmN/kRq t1mjKdVQJXjQwd7GvaQW6zYZZdo+e/yCHajikb043Up8prD1fab6kAzxk3qUysGQnJ0yw7VX9IIK5 MPGVpnZEjwGhKIq0dAuOtoJZbvwogx/kNaTPdXRObt3z0otGmuMW8ZWYdYMyFBHE02s3JUkBHYnyZ agqJsInsZdkVxoo9p6x1JstpZTdEODnW4DMClWQfyyC4XLzhCqs4Z/hx5UQOSY4o+hdXBKBPd3zlh ZQ0lpc900dFyO6jhOTVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2g39-00Eqr4-1q; Mon, 13 Nov 2023 23:08:59 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2g36-00Eqqj-3D for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 23:08:58 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507a3b8b113so7013992e87.0 for ; Mon, 13 Nov 2023 15:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699916934; x=1700521734; darn=lists.infradead.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=ACmx3TNz3KrSPf31LlnpB3IxofbprNijom9dYNvkSxs=; b=v+EueesQe0P5NlZZRtoV6Qx84pWnQsR9QtZL5Cw31EjnDo8ENS9k/ipNrtyTW94r1D ylj9fGuh3hZd25GChzdF1zUOHGpNy2xjWMku/dTWrNgXfMi0g7qeY5W7yv56Wb0hnMGq KT/SLEE6hb/KX7JPoWccID4Lwz/6WkwYyJzI2NRjxWUs6Ro96CMBognqpEGsWw9BoMfe /sKl/TDdhymxbzd6kf58aOArVHO9wc+E+Y8eQ3uZmoMg4lbcidh9FarBroCX9ShoCRu5 XyWx8QIMuic5LskQb5vA+zU5FfIpvtJ/XMO1bo/6hreP2uWscJnxtRIZh2tw3by52c1k OHMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699916934; x=1700521734; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ACmx3TNz3KrSPf31LlnpB3IxofbprNijom9dYNvkSxs=; b=qznPml9WnTcy0n/Owv9VLwtqNZnBhqXwRYGriUahDnbYX2Ff6QpZo7mhVtVYnMQ1IC uafdm0fcdt+DxtFywRuc0iL2c1VQ0T5t6hhy013goyx9WHvDw+ZDrIAAgl/mpWrS0MVv HQ7wJBhMXLfMicI5zXAZt+T5gGKVhB5zfk2ijGJ553wti4glRiCwRGFORnW3qChI7jFZ oUhyV5E5Ho65YyT5sdUcVx/P+dX7ASmtiuq7PO5cgi2V94pct8T+uVANoO9tXaa1ZHE/ q6jZM35QyL5BCslVcSvp7GGpZHEFhnUd6Sh2zZdAN/Z3JoXr9pUr033n4A3+3TwD2DWi chqQ== X-Gm-Message-State: AOJu0YxDkTf2Z9/hb/MuMLtwXfrX/uZ2wTIvtfq0UUlCUCd/IWXXuXqs XXHjHTtoO3ZwP4i45rb5h3cjfA== X-Google-Smtp-Source: AGHT+IHTUId+0HJ4T45+iwtwHrEWqjSbHl2ub84wm4qF/7cvEBUNB/FCXGvBhq2OudQkog7DHYvxzQ== X-Received: by 2002:ac2:43a6:0:b0:509:38de:9917 with SMTP id t6-20020ac243a6000000b0050938de9917mr5282007lfl.21.1699916933673; Mon, 13 Nov 2023 15:08:53 -0800 (PST) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id m9-20020ac24ac9000000b0050307bf2bcdsm1114292lfp.247.2023.11.13.15.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 15:08:53 -0800 (PST) From: Linus Walleij Date: Tue, 14 Nov 2023 00:08:47 +0100 Subject: [PATCH] ACPI: acenv: Permit compilation from within the kernel MIME-Version: 1.0 Message-Id: <20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org> X-B4-Tracking: v=1; b=H4sIAH6sUmUC/x2MQQqAIBAAvxJ7Tmi1DvaV6GC52kJZKEUg/j3pM jCHmQyJIlOCsckQ6eHEZ6iCbQPrZoInwbY6yE4qRFTCxEMsN++20gtDQ6+clYhaQ22uSI7f/zf NpXyuNDVMXwAAAA== To: "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, Linus Walleij X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_150857_110201_3A47C6A7 X-CRM114-Status: GOOD ( 14.35 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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__. This is because the header is now in the include path for : 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. Fixes: a103f46633fd ("acpi: Move common tables helper functions to common lib") Signed-off-by: Linus Walleij --- include/acpi/platform/acenv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 change-id: 20231113-arm-build-bug-ae543fd21199 Best regards, diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 337ffa931ee8..76444ffdc549 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -156,7 +156,7 @@ #endif -#if defined(_LINUX) || defined(__linux__) +#if defined(_LINUX) || defined(__linux__) || defined(__KERNEL__) #include #elif defined(_APPLE) || defined(__APPLE__)