From: Linus Walleij <linus.walleij@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Dan Williams <dan.j.williams@intel.com>,
Hanjun Guo <guohanjun@huawei.com>, Arnd Bergmann <arnd@arndb.de>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH] ACPI: acenv: Permit compilation from within the kernel
Date: Tue, 14 Nov 2023 00:08:47 +0100 [thread overview]
Message-ID: <20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org> (raw)
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 <acpi/platform/acenv.h> is now
in the include path for <linux/irq.h>:
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 <linus.walleij@linaro.org>
---
include/acpi/platform/acenv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 <acpi/platform/aclinux.h>
#elif defined(_APPLE) || defined(__APPLE__)
---
base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0
change-id: 20231113-arm-build-bug-ae543fd21199
Best regards,
--
Linus Walleij <linus.walleij@linaro.org>
next reply other threads:[~2023-11-13 23:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 23:08 Linus Walleij [this message]
2023-11-14 18:09 ` [PATCH] ACPI: acenv: Permit compilation from within the kernel Sam Edwards
2023-11-14 20:20 ` Linus Walleij
2023-11-20 15:25 ` Sam Protsenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org \
--to=linus.walleij@linaro.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=acpica-devel@lists.linux.dev \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).