mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tools headers arm64: Fix compilation failure
@ 2022-08-11  4:43 Leo Yan
  2022-08-11 10:11 ` Suzuki K Poulose
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Yan @ 2022-08-11  4:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Catalin Marinas, Anshuman Khandual,
	Suzuki K Poulose, Will Deacon, James Morse, linux-kernel
  Cc: Leo Yan

When build perf tool on x86_64, it reports failure for finding the
header <asm/sysreg.h>:

  In file included from util/arm-spe.c:37:
  util/../../arch/arm64/include/asm/cputype.h:183:10: fatal error: asm/sysreg.h: No such file or directory
    183 | #include <asm/sysreg.h>
        |          ^~~~~~~~~~~~~~
  compilation terminated.

There have no sysreg.h in x86's asm folder, alternatively, this patch
includes the sysreg.h header in the same folder with cputype.h to fix
the compilation failure.

Fixes: 37402d5d061b ("tools headers arm64: Sync arm64's cputype.h with the kernel sources")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 tools/arch/arm64/include/asm/cputype.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/arch/arm64/include/asm/cputype.h b/tools/arch/arm64/include/asm/cputype.h
index 8aa0d276a636..cddeada0ca31 100644
--- a/tools/arch/arm64/include/asm/cputype.h
+++ b/tools/arch/arm64/include/asm/cputype.h
@@ -180,7 +180,7 @@
 
 #ifndef __ASSEMBLY__
 
-#include <asm/sysreg.h>
+#include "sysreg.h"
 
 #define read_cpuid(reg)			read_sysreg_s(SYS_ ## reg)
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools headers arm64: Fix compilation failure
  2022-08-11  4:43 [PATCH] tools headers arm64: Fix compilation failure Leo Yan
@ 2022-08-11 10:11 ` Suzuki K Poulose
  2022-08-11 12:48   ` Leo Yan
  0 siblings, 1 reply; 3+ messages in thread
From: Suzuki K Poulose @ 2022-08-11 10:11 UTC (permalink / raw)
  To: Leo Yan, Arnaldo Carvalho de Melo, Catalin Marinas,
	Anshuman Khandual, Will Deacon, James Morse, linux-kernel

Hi Leo

On 11/08/2022 05:43, Leo Yan wrote:
> When build perf tool on x86_64, it reports failure for finding the
> header <asm/sysreg.h>:
> 

Please could you mention the exact build options used for the perf
build ? (e.g, enable SPE)

>    In file included from util/arm-spe.c:37:
>    util/../../arch/arm64/include/asm/cputype.h:183:10: fatal error: asm/sysreg.h: No such file or directory
>      183 | #include <asm/sysreg.h>
>          |          ^~~~~~~~~~~~~~
>    compilation terminated.
>  > There have no sysreg.h in x86's asm folder, alternatively, this patch
> includes the sysreg.h header in the same folder with cputype.h to fix
> the compilation failure.

Wondering how the "cputype.h" was picked up from arch/arm64/include/ and
why not the sysreg.h ? Ideally, we would like to pickup the kernel
headers as it is without having to manually fixup, things like this.

> 
> Fixes: 37402d5d061b ("tools headers arm64: Sync arm64's cputype.h with the kernel sources")

Also from the above commit,

"That addresses this perf build warning:

       Warning: Kernel ABI header at 
'tools/arch/arm64/include/asm/cputype.h' differs from latest version at 
'arch/arm64/include/asm/cputype.h'
       diff -u tools/arch/arm64/include/asm/cputype.h 
arch/arm64/include/asm/cputype.h
"

Wouldn't we re-introduce the warning back ?

Suzuki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools headers arm64: Fix compilation failure
  2022-08-11 10:11 ` Suzuki K Poulose
@ 2022-08-11 12:48   ` Leo Yan
  0 siblings, 0 replies; 3+ messages in thread
From: Leo Yan @ 2022-08-11 12:48 UTC (permalink / raw)
  To: Suzuki K Poulose
  Cc: Arnaldo Carvalho de Melo, Catalin Marinas, Anshuman Khandual,
	Will Deacon, James Morse, linux-kernel

Hi Suzuki,

On Thu, Aug 11, 2022 at 11:11:41AM +0100, Suzuki Kuruppassery Poulose wrote:
> Hi Leo
> 
> On 11/08/2022 05:43, Leo Yan wrote:
> > When build perf tool on x86_64, it reports failure for finding the
> > header <asm/sysreg.h>:
> > 
> 
> Please could you mention the exact build options used for the perf
> build ? (e.g, enable SPE)

Sure, yeah, I encoutered the building failure after I applied the
patch set; the first patch is to change Arm SPE code in perf.
https://lore.kernel.org/lkml/20220811062451.435810-1-leo.yan@linaro.org/

> >    In file included from util/arm-spe.c:37:
> >    util/../../arch/arm64/include/asm/cputype.h:183:10: fatal error: asm/sysreg.h: No such file or directory
> >      183 | #include <asm/sysreg.h>
> >          |          ^~~~~~~~~~~~~~
> >    compilation terminated.
> >  > There have no sysreg.h in x86's asm folder, alternatively, this patch
> > includes the sysreg.h header in the same folder with cputype.h to fix
> > the compilation failure.
> 
> Wondering how the "cputype.h" was picked up from arch/arm64/include/ and
> why not the sysreg.h ? Ideally, we would like to pickup the kernel
> headers as it is without having to manually fixup, things like this.

Actually cputype.h and sysreg.h both are copied from arch/arm64/include/
and they are placed under tools/arch/arm64/include/asm/.

> > Fixes: 37402d5d061b ("tools headers arm64: Sync arm64's cputype.h with the kernel sources")
> 
> Also from the above commit,
> 
> "That addresses this perf build warning:
> 
>       Warning: Kernel ABI header at 'tools/arch/arm64/include/asm/cputype.h'
> differs from latest version at 'arch/arm64/include/asm/cputype.h'
>       diff -u tools/arch/arm64/include/asm/cputype.h
> arch/arm64/include/asm/cputype.h
> "
> 
> Wouldn't we re-introduce the warning back ?

Good point!  Thanks for pointing out this.  So I think another option
is to tweak the CFLGAS for arm-spe.c.  The change is as below.

I will send patch out a bit later in today, please let me know if this
is fine for you?  Thanks!

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index d8fe514c9ec9..9dfae1bda9cc 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -289,6 +289,7 @@ CFLAGS_hweight.o       += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ET
 CFLAGS_parse-events.o  += -Wno-redundant-decls
 CFLAGS_expr.o          += -Wno-redundant-decls
 CFLAGS_header.o        += -include $(OUTPUT)PERF-VERSION-FILE
+CFLAGS_arm-spe.o       += -I$(srctree)/tools/arch/arm64/include/
 
 $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
        $(call rule_mkdir)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-11 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11  4:43 [PATCH] tools headers arm64: Fix compilation failure Leo Yan
2022-08-11 10:11 ` Suzuki K Poulose
2022-08-11 12:48   ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®