* [PATCH] ACPI: tools: fix compilation error
@ 2021-10-06 5:13 Miguel Bernal Marin
2021-10-07 17:19 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Miguel Bernal Marin @ 2021-10-06 5:13 UTC (permalink / raw)
To: Rafael J Wysocki, Len Brown, Robert Moore; +Cc: linux-kernel, linux-acpi, devel
When acpi tools are compiled the following error is showed:
$ cd tools/power/acpi
$ make
DESCEND tools/acpidbg
MKDIR include
CP include
CC tools/acpidbg/acpidbg.o
In file included from /home/linux/tools/power/acpi/include/acpi/platform/acenv.h:152,
from /home/linux/tools/power/acpi/include/acpi/acpi.h:22,
from acpidbg.c:9:
/home/linux/tools/power/acpi/include/acpi/platform/acgcc.h:25:10: fatal error: linux/stdarg.h: No such file or directory
29 | #include <linux/stdarg.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
Keep the same logic from ACPICA, just identify when is used inside kernel
or by acpi tool.
Fixes: c0891ac15f04 ("isystem: ship and use stdarg.h")
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
---
include/acpi/platform/acgcc.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index fb172a03a753..20ecb004f5a4 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -22,9 +22,14 @@ typedef __builtin_va_list va_list;
#define va_arg(v, l) __builtin_va_arg(v, l)
#define va_copy(d, s) __builtin_va_copy(d, s)
#else
+#ifdef __KERNEL__
#include <linux/stdarg.h>
-#endif
-#endif
+#else
+/* Used to build acpi tools */
+#include <stdarg.h>
+#endif /* __KERNEL__ */
+#endif /* ACPI_USE_BUILTIN_STDARG */
+#endif /* ! va_arg */
#define ACPI_INLINE __inline__
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: tools: fix compilation error
2021-10-06 5:13 [PATCH] ACPI: tools: fix compilation error Miguel Bernal Marin
@ 2021-10-07 17:19 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-10-07 17:19 UTC (permalink / raw)
To: Miguel Bernal Marin
Cc: Rafael J Wysocki, Len Brown, Robert Moore,
Linux Kernel Mailing List, ACPI Devel Maling List,
open list:ACPI COMPONENT ARCHITECTURE (ACPICA)
On Wed, Oct 6, 2021 at 7:13 AM Miguel Bernal Marin
<miguel.bernal.marin@linux.intel.com> wrote:
>
> When acpi tools are compiled the following error is showed:
>
> $ cd tools/power/acpi
> $ make
> DESCEND tools/acpidbg
> MKDIR include
> CP include
> CC tools/acpidbg/acpidbg.o
> In file included from /home/linux/tools/power/acpi/include/acpi/platform/acenv.h:152,
> from /home/linux/tools/power/acpi/include/acpi/acpi.h:22,
> from acpidbg.c:9:
> /home/linux/tools/power/acpi/include/acpi/platform/acgcc.h:25:10: fatal error: linux/stdarg.h: No such file or directory
> 29 | #include <linux/stdarg.h>
> | ^~~~~~~~~~~~~~~~
> compilation terminated.
>
> Keep the same logic from ACPICA, just identify when is used inside kernel
> or by acpi tool.
>
> Fixes: c0891ac15f04 ("isystem: ship and use stdarg.h")
> Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
> ---
> include/acpi/platform/acgcc.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
> index fb172a03a753..20ecb004f5a4 100644
> --- a/include/acpi/platform/acgcc.h
> +++ b/include/acpi/platform/acgcc.h
> @@ -22,9 +22,14 @@ typedef __builtin_va_list va_list;
> #define va_arg(v, l) __builtin_va_arg(v, l)
> #define va_copy(d, s) __builtin_va_copy(d, s)
> #else
> +#ifdef __KERNEL__
> #include <linux/stdarg.h>
> -#endif
> -#endif
> +#else
> +/* Used to build acpi tools */
> +#include <stdarg.h>
> +#endif /* __KERNEL__ */
> +#endif /* ACPI_USE_BUILTIN_STDARG */
> +#endif /* ! va_arg */
>
> #define ACPI_INLINE __inline__
>
> --
Applied as 5.16 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-07 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 5:13 [PATCH] ACPI: tools: fix compilation error Miguel Bernal Marin
2021-10-07 17:19 ` Rafael J. Wysocki
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 NNTP newsgroup(s).