2019-01-11 05:20:35

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 0/3] powerpc: some header search path cleanups

I am trying to get rid of crappy magic from Kbuild core makefiles.

Before that, I want to drop as many useless paths as possible.
Actually, many Makefiles are adding around pointless options.

This series cleans some powerpc Makefiles.
(only compile-tested by 0day bot)



Masahiro Yamada (3):
KVM: powerpc: remove -I. header search paths
powerpc: remove redundant header search path additions
powerpc: math-emu: remove unneeded header search paths

arch/powerpc/Makefile | 4 ++--
arch/powerpc/kvm/Makefile | 5 -----
arch/powerpc/math-emu/Makefile | 2 +-
3 files changed, 3 insertions(+), 8 deletions(-)

--
2.7.4



2019-01-11 05:19:34

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 1/3] KVM: powerpc: remove -I. header search paths

The header search path -I. in kernel Makefiles is very suspicious;
it allows the compiler to search for headers in the top of $(srctree),
where obviously no header file exists.

Commit 46f43c6ee022 ("KVM: powerpc: convert marker probes to event
trace") first added these options, but they are completely useless.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/powerpc/kvm/Makefile | 5 -----
1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 64f1135..3223aec 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -10,11 +10,6 @@ common-objs-y = $(KVM)/kvm_main.o $(KVM)/eventfd.o
common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o
common-objs-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o

-CFLAGS_e500_mmu.o := -I.
-CFLAGS_e500_mmu_host.o := -I.
-CFLAGS_emulate.o := -I.
-CFLAGS_emulate_loadstore.o := -I.
-
common-objs-y += powerpc.o emulate_loadstore.o
obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
--
2.7.4


2019-01-11 05:20:06

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 3/3] powerpc: math-emu: remove unneeded header search paths

The header search path -I. in kernel Makefiles is very suspicious;
it allows the compiler to search for headers in the top of $(srctree),
where obviously no header file exists.

-Iinclude/math-emu seems unnecessary because all files include headers
in the form of #include <math-emu/...>.

I was able to build without these header search paths.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/powerpc/math-emu/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/math-emu/Makefile b/arch/powerpc/math-emu/Makefile
index 494df26..a879403 100644
--- a/arch/powerpc/math-emu/Makefile
+++ b/arch/powerpc/math-emu/Makefile
@@ -17,4 +17,4 @@ obj-$(CONFIG_SPE) += math_efp.o
CFLAGS_fabs.o = -fno-builtin-fabs
CFLAGS_math.o = -fno-builtin-fabs

-ccflags-y = -I. -Iinclude/math-emu -w
+ccflags-y = -w
--
2.7.4


2019-01-11 05:20:46

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 2/3] powerpc: remove redundant header search path additions

The same path -Iarch/$(ARCH) is passed to KBUILD_CPPFLAGS,
KBUILD_AFLAGS, and KBUILD_CFLAGS.

As you see in scripts/Makefile.lib, KBUILD_CPPFLAGS is passed
to c_flags and a_flags as well.

Passing it to KBUILD_CPPFLAGS is enough.

Signed-off-by: Masahiro Yamada <[email protected]>
---

arch/powerpc/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 488c9ed..ac03334 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -213,9 +213,9 @@ endif
asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)

KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr)
-KBUILD_AFLAGS += -Iarch/$(ARCH) $(AFLAGS-y)
+KBUILD_AFLAGS += $(AFLAGS-y)
KBUILD_CFLAGS += $(call cc-option,-msoft-float)
-KBUILD_CFLAGS += -pipe -Iarch/$(ARCH) $(CFLAGS-y)
+KBUILD_CFLAGS += -pipe $(CFLAGS-y)
CPP = $(CC) -E $(KBUILD_CFLAGS)

CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__
--
2.7.4


2019-01-18 02:52:57

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 0/3] powerpc: some header search path cleanups

Hi Michael,


On Fri, Jan 11, 2019 at 2:20 PM Masahiro Yamada
<[email protected]> wrote:
>
> I am trying to get rid of crappy magic from Kbuild core makefiles.
>
> Before that, I want to drop as many useless paths as possible.
> Actually, many Makefiles are adding around pointless options.
>
> This series cleans some powerpc Makefiles.
> (only compile-tested by 0day bot)


Could you apply this series to ppc tree if you are fine with it?





> Masahiro Yamada (3):
> KVM: powerpc: remove -I. header search paths
> powerpc: remove redundant header search path additions
> powerpc: math-emu: remove unneeded header search paths
>
> arch/powerpc/Makefile | 4 ++--
> arch/powerpc/kvm/Makefile | 5 -----
> arch/powerpc/math-emu/Makefile | 2 +-
> 3 files changed, 3 insertions(+), 8 deletions(-)
>
> --
> 2.7.4
>


--
Best Regards
Masahiro Yamada

2019-01-24 03:42:06

by Michael Ellerman

[permalink] [raw]
Subject: Re: [1/3] KVM: powerpc: remove -I. header search paths

On Fri, 2019-01-11 at 03:22:31 UTC, Masahiro Yamada wrote:
> The header search path -I. in kernel Makefiles is very suspicious;
> it allows the compiler to search for headers in the top of $(srctree),
> where obviously no header file exists.
>
> Commit 46f43c6ee022 ("KVM: powerpc: convert marker probes to event
> trace") first added these options, but they are completely useless.
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c142e9741e61577c45f2441214c999f2

cheers